fix chattts

This commit is contained in:
bojiang
2024-05-31 22:48:13 +08:00
parent b8467aa09e
commit 5e67ca4dcf
2 changed files with 5 additions and 1 deletions

View File

@@ -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

View File

@@ -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