Skip to content
Open
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
1 change: 1 addition & 0 deletions docs/source/openvino/models.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Here is the list of the supported architectures :
- CLIP
- CamemBERT
- ChatGLM (ChatGLM2, ChatGLM3, GLM4)
- Chatterbox (text-to-speech, English and multilingual)
- CodeGen
- CodeGen2
- Cohere
Expand Down
2 changes: 1 addition & 1 deletion optimum/commands/export/openvino.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def parse_args_openvino(parser: "ArgumentParser"):
optional_group.add_argument(
"--library",
type=str,
choices=["transformers", "diffusers", "timm", "sentence_transformers", "open_clip", "kokoro"],
choices=["transformers", "diffusers", "timm", "sentence_transformers", "open_clip", "kokoro", "chatterbox"],
default=None,
help="The library used to load the model before export. If not provided, will attempt to infer the local checkpoint's library",
)
Expand Down
7 changes: 6 additions & 1 deletion optimum/exporters/openvino/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
is_transformers_version,
)
from optimum.intel.utils.modeling_utils import (
_ChatterboxForTextToSpeech,
_infer_library_from_model_name_or_path,
_KokoroForTextToSpeech,
_OpenClipForZeroShotImageClassification,
Expand Down Expand Up @@ -87,7 +88,7 @@ def infer_task(
if task == "auto":
if library_name == "open_clip":
task = "zero-shot-image-classification"
elif library_name == "kokoro":
elif library_name in ("kokoro", "chatterbox"):
task = "text-to-audio"
else:
try:
Expand Down Expand Up @@ -518,6 +519,10 @@ def bitnet_load_hook(self, state_dict, prefix, *args, **kwargs):
model = _OpenClipForZeroShotImageClassification.from_pretrained(model_name_or_path, cache_dir=cache_dir)
elif library_name == "kokoro":
model = _KokoroForTextToSpeech.from_pretrained(model_name_or_path, cache_dir=cache_dir, token=token)
elif library_name == "chatterbox":
model = _ChatterboxForTextToSpeech.from_pretrained(
model_name_or_path, cache_dir=cache_dir, token=token, **loading_kwargs
)
else:
# remote code models like phi3_v internvl2, minicpmv, internvl2, nanollava, maira2 should be loaded using AutoModelForCausalLM and not AutoModelForImageTextToText
# TODO: use config.auto_map to load remote code models instead (for other models we can directly use config.architectures)
Expand Down
Loading