Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update outetts according new repo structure #2569

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .ci/skipped_notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,8 @@
skips:
- os:
- macos-13
- python:
- '3.9'
- notebook: notebooks/mobileclip-video-search/mobileclip-video-search.ipynb
skips:
- os:
Expand All @@ -562,4 +564,4 @@
- macos-13
- ubuntu-20.04
- ubuntu-22.04
- windows-2019
- windows-2019
215 changes: 75 additions & 140 deletions notebooks/outetts-text-to-speech/outetts-text-to-speech.ipynb

Large diffs are not rendered by default.

23 changes: 18 additions & 5 deletions notebooks/outetts-text-to-speech/ov_outetts_helper.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
from outetts.v0_1.interface import InterfaceHF
from outetts.v0_1.audio_codec import AudioCodec
from outetts.v0_1.prompt_processor import PromptProcessor
from outetts.v0_1.model import HFModel
import torch
from optimum.intel.openvino import OVModelForCausalLM

try:
from outetts.version.v1.interface import InterfaceHF
from outetts.version.v1.prompt_processor import PromptProcessor
from outetts.version.v1.model import HFModel
from outetts.wav_tokenizer.audio_codec import AudioCodec
updated_version = True
except ImportError:
from outetts.v0_1.interface import InterfaceHF
from outetts.v0_1.audio_codec import AudioCodec
from outetts.v0_1.prompt_processor import PromptProcessor
from outetts.v0_1.model import HFModel
updated_version = False


class OVHFModel(HFModel):
def __init__(self, model_path, device):
Expand All @@ -20,5 +29,9 @@ def __init__(
) -> None:
self.device = torch.device("cpu")
self.audio_codec = AudioCodec(self.device)
self.prompt_processor = PromptProcessor(model_path)
self.prompt_processor = PromptProcessor(model_path) if not updated_version else PromptProcessor(model_path, ["en"])
self.model = OVHFModel(model_path, device)
self.language = "en"
self.verbose = False
self.languages = ["en"]
self._device = torch.device("cpu")
Loading