Coder Social home page Coder Social logo

jaketae / storyteller Goto Github PK

View Code? Open in Web Editor NEW
488.0 14.0 63.0 4.7 MB

Multimodal AI Story Teller, built with Stable Diffusion, GPT, and neural text-to-speech

License: MIT License

Python 100.00%
gpt image-generation pytorch stable-diffusion text-to-image text-to-speech text-to-video video-generation ddpm diffusion-models

storyteller's Introduction

StoryTeller

Open In Colab Code style: black pre-commit License: MIT

A multimodal AI storyteller, built with Stable Diffusion, GPT, and neural text-to-speech (TTS).

Given a prompt as an opening line of a story, GPT writes the rest of the plot; Stable Diffusion draws an image for each sentence; a TTS model narrates each line, resulting in a fully animated video of a short story, replete with audio and visuals.

Example output generated with the default prompt.

Installation

PyPI

Story Teller is available on PyPI.

$ pip install storyteller-core

Source

  1. Clone the repository.
$ git clone https://github.com/jaketae/storyteller.git
$ cd storyteller
  1. Install dependencies.
$ pip install .

Note

For Apple Silicon users, mecab-python3 is not available. You need to install mecab before running pip install. You can do this with Hombrew via brew install mecab. For more information, refer to SamuraiT/mecab-python3#84.

  1. (Optional) To develop locally, install dev dependencies and install pre-commit hooks. This will automatically trigger linting and code quality checks before each commit.
$ pip install -e .[dev]
$ pre-commit install

Quickstart

The quickest way to run a demo is by using the command line interface (CLI). To get started, simply type:

$ storyteller

This command will initialize the story with the default prompt of Once upon a time, unicorns roamed the Earth. An example of the output that will be generated can be seen in the animation above. You can customize the beginning of your story by using the --writer_prompt argument. For example, if you would like to start your story with the text The ravenous cat, driven by an insatiable craving for tuna, devised a daring plan to break into the local fish market's coveted tuna reserve., your CLI command would look as follows:

storyteller --writer_prompt "The ravenous cat, driven by an insatiable craving for tuna, devised a daring plan to break into the local fish market's coveted tuna reserve."

The final video will be saved in the /out/out.mp4 directory, along with other intermediate files such as images, audio files, and subtitles.

To adjust the default settings with custom parameters, you can use the different CLI flags as needed. To see a list of all available options, type:

$ storyteller --help

This will provide you with a list of the options, their descriptions and their defaults.

options:
  -h, --help            show this help message and exit
  --writer_prompt WRITER_PROMPT
                        The prompt to be used for the writer model. This is the text with which your story will begin. Default:
                        'Once upon a time, unicorns roamed the Earth.'
  --painter_prompt_prefix PAINTER_PROMPT_PREFIX
                        The prefix to be used for the painter model's prompt. Default: 'Beautiful painting'
  --num_images NUM_IMAGES
                        The number of images to be generated. Those images will be composed in sequence into a video. Default:
                        10
  --output_dir OUTPUT_DIR
                        The directory to save the generated files to. Default: 'out'
  --seed SEED           The seed value to be used for randomization. Default: 42
  --max_new_tokens MAX_NEW_TOKENS
                        Maximum number of new tokens to generate in the writer model. Default: 50
  --writer WRITER       Text generation model to use. Default: 'gpt2'
  --painter PAINTER     Image generation model to use. Default: 'stabilityai/stable-diffusion-2'
  --speaker SPEAKER     Text-to-speech (TTS) generation model. Default: 'tts_models/en/ljspeech/glow-tts'
  --writer_device WRITER_DEVICE
                        Text generation device to use. Default: 'cpu'
  --painter_device PAINTER_DEVICE
                        Image generation device to use. Default: 'cpu'
  --writer_dtype WRITER_DTYPE
                        Text generation dtype to use. Default: 'float32'
  --painter_dtype PAINTER_DTYPE
                        Image generation dtype to use. Default: 'float32'
  --enable_attention_slicing ENABLE_ATTENTION_SLICING
                        Whether to enable attention slicing for diffusion. Default: 'False'

Usage

Command Line Interface

CUDA

If you have a CUDA-enabled machine, run

$ storyteller --writer_device cuda --painter_device cuda

to utilize GPU.

You can also place each model on separate devices if loading all models on a single device exceeds available VRAM.

$ storyteller --writer_device cuda:0 --painter_device cuda:1

$ For faster generation, consider using half-precision.

$ storyteller --writer_device cuda --painter_device cuda --writer_dtype float16 --painter_dtype float16

Apple Silicon

Note

PyTorch support for Apple Silicon (MPS) is work in progress. At the time of writing, torch.cumsum does not work with torch.int64 (issue) on PyTorch stable 2.0.1; it works on nightly only.

If you are on an Apple Silicon machine, run

$ storyteller --writer_device mps --painter_device mps

if you want to use MPS acceleration for both models.

For faster generation, consider enabling attention-slicing to save on memory.

$ storyteller --enable_attention_slicing true

Python

For more advanced use cases, you can also directly interface with Story Teller in Python code.

  1. Load the model with defaults.
from storyteller import StoryTeller

story_teller = StoryTeller.from_default()
story_teller.generate(...)
  1. Alternatively, configure the model with custom settings.
from storyteller import StoryTeller, StoryTellerConfig

config = StoryTellerConfig(
    writer="gpt2-large",
    painter="CompVis/stable-diffusion-v1-4",
    max_new_tokens=100,
)

story_teller = StoryTeller(config)
story_teller.generate(...)

License

Released under the MIT License.

storyteller's People

Contributors

christopherwoodall avatar iluxonchik avatar itsyogesh avatar jaketae avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

storyteller's Issues

How do I run this?

I cloned as instructed.
Installed python as instructed.
Did update as instructed, but some files were not updated
"ERROR: Could not find a version that satisfies the requirement tts (from storyteller[dev]) (from versions: none)
ERROR: No matching distribution found for tts"

After that I am completely lost as to how I run it?
Tried $storyteller, but error
Tried $ python pyproject.toml
Tried all other combinations, but because lack of expertise, unable to run it. Can you please give instructions for someone not sound with programming, a Layman explanation.

[TODO] Add `speaker_device`

Context

Currently, the StoryTellerConfig only allows users to specify devices for the painter (diffusion model) and writer (causal LM). This is largely because the Coqui TTS API doesn't appear to support model loading onto specific devices. See coqui-ai/TTS#2282.

Solution

Once the referenced issue reaches resolution in upstream, make adjustments to the project to support more granular TTS model loading behavior.

Disable TTS and other features

Hey, great work! I tried the Google Colab demo, and it actually works well. However, I have a couple of questions. How can I completely disable the TTS (Text-to-Speech) feature, as I don't want TTS in my videos? Also, I have another question: Is there any way to simplify the code to only generate images based on the story, without including SRT files, TTS, or the final video? So it becomes story(text) to images?

TypeError: 'staticmethod' object is not callable

$storyteller --writer_prompt "The ravenous cat, driven by an insatiable craving for tuna, devised a daring plan to break into the local fish market's coveted tuna reserve."
Traceback (most recent call last):
File "/home/m/.local/bin/storyteller", line 5, in
from storyteller.cli import main
File "/home/m/.local/lib/python3.8/site-packages/storyteller/init.py", line 3, in
from storyteller.config import StoryTellerConfig
File "/home/m/.local/lib/python3.8/site-packages/storyteller/config.py", line 46, in
class StoryTellerConfigArgparseHelpText:
File "/home/m/.local/lib/python3.8/site-packages/storyteller/config.py", line 53, in StoryTellerConfigArgparseHelpText
_get_dataclass_var_name_from_f_string_eq(
TypeError: 'staticmethod' object is not callable

My system:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal

Python 3.8.10

no .mp4 file in "out" folder

Hi, i have .png, .wav. and .srt files but i don't see .mp4 final file in "out" folder. Could you check it?
Regards,

[TODO] Support batch image generation

Context

Currently, StoryTeller.generate() generates one image at a time. This is for ease of implementation: we generate one image, a subtitle file, and an audio file, then stitch them together to create one frame.

Solution

To speed up generation on GPUs, support batch generation. This is simple with HF's pipeline:

images = self.painter([prompt1, prompt2, ...])

Issue during installation for M1 mac

Hi folks,

I was trying to install the required packages but it seems there is an issue with mecab-python3. Here is the error log I saw:

 × Running setup.py install for mecab-python3 did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      /Users/yogesh/Projects/Playground/storyteller/.env/lib/python3.10/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
        warnings.warn(
      running install
      /Users/yogesh/Projects/Playground/storyteller/.env/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.macosx-13.1-arm64-cpython-310
      creating build/lib.macosx-13.1-arm64-cpython-310/MeCab
      copying src/MeCab/__init__.py -> build/lib.macosx-13.1-arm64-cpython-310/MeCab
      copying src/MeCab/cli.py -> build/lib.macosx-13.1-arm64-cpython-310/MeCab
      running build_ext
      error: [Errno 2] No such file or directory: 'mecab-config'
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> mecab-python3

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I am using an M1 Mac so I am not sure if there any additional steps I missed.

AssertionError: Torch not compiled with CUDA enabled

Describe the bug

storyteller --writer_device cuda
WARNING[XFORMERS]: xFormers can't load C++/CUDA extensions. xFormers was built for:
PyTorch 1.13.1+cu117 with CUDA 1107 (you have 2.1.2+cpu)
Python 3.10.9 (you have 3.10.11)
Please reinstall xformers (see https://github.com/facebookresearch/xformers#installing-xformers)
Memory-efficient attention, SwiGLU, sparse and more won't be available.
Set XFORMERS_MORE_DETAILS=1 for more details
Traceback (most recent call last):
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\Scripts\storyteller.exe_main
.py", line 7, in
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\storyteller\cli.py", line 75, in main
story_teller = StoryTeller(config)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\storyteller\utils.py", line 23, in wrapper_func
func(*args, **kwargs)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\storyteller\utils.py", line 37, in wrapper_func
func(*args, **kwargs)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\storyteller\model.py", line 29, in init
self.writer = pipeline(
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\pipelines_init
.py", line 1070, in pipeline
return pipeline_class(model=model, framework=framework, task=task, **kwargs)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\pipelines\text_generation.py", line 70, in init
super().init(*args, **kwargs)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\pipelines\base.py", line 840, in init
self.model.to(self.device)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\transformers\modeling_utils.py", line 2595, in to
return super().to(*args, **kwargs)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1160, in to
return self._apply(convert)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 810, in _apply
module._apply(fn)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 810, in _apply
module._apply(fn)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 833, in apply
param_applied = fn(param)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\nn\modules\module.py", line 1158, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
File "C:\Users\mero\AppData\Local\Programs\Python\Python310\lib\site-packages\torch\cuda_init
.py", line 289, in _lazy_init
raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Wed_Nov_22_10:30:42_Pacific_Standard_Time_2023
Cuda compilation tools, release 12.3, V12.3.107
Build cuda_12.3.r12.3/compiler.33567101_0

nvidia-smi
Sun Feb 11 11:18:17 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 551.23 Driver Version: 551.23 CUDA Version: 12.4 |
|-----------------------------------------+------------------------+----------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+========================+======================|
| 0 NVIDIA GeForce RTX 4070 WDDM | 00000000:01:00.0 On | N/A |
| 0% 49C P0 30W / 215W | 704MiB / 12282MiB | 0% Default |
| | | N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=========================================================================================|
| 0 N/A N/A 1764 C+G ...nt.CBS_cw5n1h2txyewy\SearchHost.exe N/A |
| 0 N/A N/A 4080 C+G ...2txyewy\StartMenuExperienceHost.exe N/A |
| 0 N/A N/A 5752 C+G ...GeForce Experience\NVIDIA Share.exe N/A |
| 0 N/A N/A 16124 C+G ...n\121.0.2277.106\msedgewebview2.exe N/A |
| 0 N/A N/A 16416 C+G ...oogle\Chrome\Application\chrome.exe N/A |
| 0 N/A N/A 16624 C+G C:\Windows\explorer.exe N/A |
| 0 N/A N/A 18292 C+G ...2.0_x64__cv1g1gvanyjgm\WhatsApp.exe N/A |
| 0 N/A N/A 18656 C+G ...siveControlPanel\SystemSettings.exe N/A |
| 0 N/A N/A 20540 C+G ...ogram Files\Notepad++\notepad++.exe N/A |
| 0 N/A N/A 20768 C+G ...US\ArmouryDevice\asus_framework.exe N/A |
| 0 N/A N/A 21440 C+G ...5n1h2txyewy\ShellExperienceHost.exe N/A |
| 0 N/A N/A 26836 C+G ...__8wekyb3d8bbwe\WindowsTerminal.exe N/A |
+-----------------------------------------------------------------------------------------+

Desktop (please complete the following information):

  • Windows 11

How to keep the consistency between images?

This is a wonderful work that meets my best need! I have a little problem and cusious how you cool guys do it:
The gif in read.me is fluent, smooth, with cosistent style. So, what's the point of doing that?

RuntimeError: Numpy is not available

I am getting the error below while I hace installed numpy-1.22.4

storyteller
[nltk_data] Downloading package punkt to
[nltk_data] C:\Users\xxx\AppData\Roaming\nltk_data...
[nltk_data] Package punkt is already up-to-date!
Fetching 16 files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 16/16 [00:00<00:00, 5335.42it/s]
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\Scripts\storyteller.exe_main
.py", line 7, in
File "E:\Ai__Project\storyteller\storyteller_main
.py", line 18, in main
story_teller = StoryTeller.from_default()
File "E:\Ai__Project\storyteller\storyteller\model.py", line 46, in from_default
return cls(config)
File "E:\Ai__Project\storyteller\storyteller\model.py", line 34, in init
self.painter = StableDiffusionPipeline.from_pretrained(
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\pipeline_utils.py", line 708, in from_pretrained
loaded_sub_model = load_method(os.path.join(cached_folder, name), **loading_kwargs)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\schedulers\scheduling_utils.py", line 124, in from_pretrained
return cls.from_config(config, return_unused_kwargs=return_unused_kwargs, **kwargs)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\configuration_utils.py", line 210, in from_config
model = cls(**init_dict)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\configuration_utils.py", line 567, in inner_init
init(self, *args, **init_kwargs)
File "C:\Users\xxx\AppData\Local\Programs\Python\Python310\lib\site-packages\diffusers\schedulers\scheduling_ddim.py", line 170, in init
self.timesteps = torch.from_numpy(np.arange(0, num_train_timesteps)[::-1].copy().astype(np.int64))
RuntimeError: Numpy is not available

Improve Argument Description and Add a Clearer Description Of The Quickstart

Describe the bug

$ storyteller --help

Does not provide you with a lot of useful information. Arguments are listed, but they are not described, as such it is not clear how the CLI should be operated. This information should also be reflected in the documentation.

To Reproduce

Run

$ storyteller --help

Expected behavior
Argument description and defaults are clear.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Any
  • Browser -
  • Version -

CUDA out of memory NVIDIA 2060 6G

Traceback (most recent call last):
File "C:\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Python39\Scripts\storyteller.exe_main
.py", line 7, in
File "C:\Python39\lib\site-packages\storyteller\cli.py", line 39, in main
story_teller = StoryTeller(config)
File "C:\Python39\lib\site-packages\storyteller\utils.py", line 22, in wrapper_func
func(*args, **kwargs)
File "C:\Python39\lib\site-packages\storyteller\utils.py", line 36, in wrapper_func
func(*args, **kwargs)
File "C:\Python39\lib\site-packages\storyteller\model.py", line 31, in init
self.painter = StableDiffusionPipeline.from_pretrained(
File "C:\Python39\lib\site-packages\diffusers\pipeline_utils.py", line 270, in to
module.to(torch_device)
File "C:\Python39\lib\site-packages\transformers\modeling_utils.py", line 1749, in to
return super().to(*args, **kwargs)
File "C:\Python39\lib\site-packages\torch\nn\modules\module.py", line 852, in to
return self._apply(convert)
File "C:\Python39\lib\site-packages\torch\nn\modules\module.py", line 530, in _apply
module._apply(fn)
File "C:\Python39\lib\site-packages\torch\nn\modules\module.py", line 530, in _apply
module._apply(fn)
File "C:\Python39\lib\site-packages\torch\nn\modules\module.py", line 530, in _apply
module._apply(fn)
[Previous line repeated 3 more times]
File "C:\Python39\lib\site-packages\torch\nn\modules\module.py", line 552, in _apply
param_applied = fn(param)
File "C:\Python39\lib\site-packages\torch\nn\modules\module.py", line 850, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
RuntimeError: CUDA out of memory. Tried to allocate 20.00 MiB (GPU 0; 6.00 GiB total capacity; 5.23 GiB already allocated; 0 bytes free; 5.30 GiB reserved in total by PyTorch)

Crashes MeCab.Tagger()

Traceback (most recent call last):
File "/opt/homebrew/bin/storyteller", line 8, in
sys.exit(main())
File "/opt/homebrew/lib/python3.10/site-packages/storyteller/cli.py", line 39, in main
story_teller = StoryTeller(config)
File "/opt/homebrew/lib/python3.10/site-packages/storyteller/utils.py", line 23, in wrapper_func
func(*args, **kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/storyteller/utils.py", line 37, in wrapper_func
func(*args, **kwargs)
File "/opt/homebrew/lib/python3.10/site-packages/storyteller/model.py", line 35, in init
self.speaker = TTS(config.speaker)
File "/opt/homebrew/lib/python3.10/site-packages/TTS/api.py", line 31, in init
self.load_model_by_name(model_name, gpu)
File "/opt/homebrew/lib/python3.10/site-packages/TTS/api.py", line 81, in load_model_by_name
self.synthesizer = Synthesizer(
File "/opt/homebrew/lib/python3.10/site-packages/TTS/utils/synthesizer.py", line 75, in init
self._load_tts(tts_checkpoint, tts_config_path, use_cuda)
File "/opt/homebrew/lib/python3.10/site-packages/TTS/utils/synthesizer.py", line 112, in _load_tts
self.tts_model = setup_tts_model(config=self.tts_config)
File "/opt/homebrew/lib/python3.10/site-packages/TTS/tts/models/init.py", line 12, in setup_model
MyModel = find_module("TTS.tts.models", config.model.lower())
File "/opt/homebrew/lib/python3.10/site-packages/TTS/utils/generic_utils.py", line 93, in find_module
module = importlib.import_module(module_path + "." + module_name)
File "/opt/homebrew/Cellar/[email protected]/3.10.9/Frameworks/Python.framework/Versions/3.10/lib/python3.10/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1050, in _gcd_import
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/opt/homebrew/lib/python3.10/site-packages/TTS/tts/models/glow_tts.py", line 17, in
from TTS.tts.utils.text.tokenizer import TTSTokenizer
File "/opt/homebrew/lib/python3.10/site-packages/TTS/tts/utils/text/init.py", line 1, in
from TTS.tts.utils.text.tokenizer import TTSTokenizer
File "/opt/homebrew/lib/python3.10/site-packages/TTS/tts/utils/text/tokenizer.py", line 5, in
from TTS.tts.utils.text.phonemizers import DEF_LANG_TO_PHONEMIZER, get_phonemizer_by_name
File "/opt/homebrew/lib/python3.10/site-packages/TTS/tts/utils/text/phonemizers/init.py", line 4, in
from TTS.tts.utils.text.phonemizers.ja_jp_phonemizer import JA_JP_Phonemizer
File "/opt/homebrew/lib/python3.10/site-packages/TTS/tts/utils/text/phonemizers/ja_jp_phonemizer.py", line 3, in
from TTS.tts.utils.text.japanese.phonemizer import japanese_text_to_phonemes
File "/opt/homebrew/lib/python3.10/site-packages/TTS/tts/utils/text/japanese/phonemizer.py", line 352, in
_TAGGER = MeCab.Tagger()
File "/opt/homebrew/lib/python3.10/site-packages/MeCab.py", line 355, in init
_MeCab.Tagger_swiginit(self, _MeCab.new_Tagger(*args))
RuntimeError

storyteller failed, ?

C:\Users\dengz\Downloads\story>storyteller
[nltk_data] Downloading package punkt to
[nltk_data] C:\Users\dengz\AppData\Roaming\nltk_data...
[nltk_data] Unzipping tokenizers\punkt.zip.
Downloading: 100%|█████████████████████████████████████████████████████████████████████| 665/665 [00:00<00:00, 168kB/s]
Downloading: 72%|████████████████████████████████████████████████▎ | 395M/548M [12:20<04:47, 533kB/s]
Traceback (most recent call last):
File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Python310\Scripts\storyteller.exe_main
.py", line 7, in
File "C:\Python310\lib\site-packages\storyteller\cli.py", line 39, in main
story_teller = StoryTeller(config)
File "C:\Python310\lib\site-packages\storyteller\utils.py", line 22, in wrapper_func
func(*args, **kwargs)
File "C:\Python310\lib\site-packages\storyteller\utils.py", line 36, in wrapper_func
func(*args, **kwargs)
File "C:\Python310\lib\site-packages\storyteller\model.py", line 28, in init
self.writer = pipeline(
File "C:\Python310\lib\site-packages\transformers\pipelines_init
.py", line 724, in pipeline
framework, model = infer_framework_load_model(
File "C:\Python310\lib\site-packages\transformers\pipelines\base.py", line 266, in infer_framework_load_model
raise ValueError(f"Could not load model {model} with any of the following classes: {class_tuple}.")
ValueError: Could not load model gpt2 with any of the following classes: (<class 'transformers.models.auto.modeling_auto.AutoModelForCausalLM'>, <class 'transformers.models.gpt2.modeling_gpt2.GPT2LMHeadModel'>).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.