mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-01-18 20:41:11 -05:00
fix chattts
This commit is contained in:
@@ -8,6 +8,9 @@ include:
|
||||
python:
|
||||
requirements_txt: "./requirements.txt"
|
||||
lock_packages: true
|
||||
docker:
|
||||
system_packages:
|
||||
- libsox-dev
|
||||
envs:
|
||||
- name: CHAT_TTS_REPO
|
||||
value: https://github.com/2noise/ChatTTS.git
|
||||
|
||||
@@ -4,6 +4,7 @@ from typing import Annotated
|
||||
import sys
|
||||
import shutil
|
||||
import io
|
||||
import pathlib
|
||||
|
||||
import bentoml
|
||||
from bentoml.validators import ContentType
|
||||
@@ -46,7 +47,7 @@ class Main:
|
||||
self.chat.load_models(compile=False) # Set to True for better performance
|
||||
|
||||
@bentoml.api
|
||||
def tts(self, text: str = "PUT YOUR TEXT HERE") -> Annotated[bytes, ContentType("audio/wav")]:
|
||||
def tts(self, text: str = "PUT YOUR TEXT HERE") -> Annotated[pathlib.Path, ContentType("audio/wav")]:
|
||||
import torch
|
||||
import torchaudio
|
||||
|
||||
|
||||
Reference in New Issue
Block a user