Closed ayushi15092002 closed 1 month ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You might also look our discussion channels.
Describe the bug
When I send more than one sentence, it is giving me the error.
To Reproduce
Input Text: a tree is a perennial plant with an elongated stem, or trunk, usually supporting branches and leaves. In some usages, the definition of a tree may be narrower, including only woody plants with secondary growth, plants that are usable as lumber or plants above a specified height.
import os from TTS.api import TTS TTS_MODEL_PATH = "tts_models/multilingual/multi-dataset/xtts_v2" tts = TTS(model_name=TTS_MODEL_PATH, gpu=True)
def text_to_speech(text, speaker_wav_file, language, output_path): os.makedirs(os.path.dirname(output_path), exist_ok=True) tts.tts_to_file(text, speaker_wav=speaker_wav_file, language=language, file_path=output_path) return output_path
@app.route('/text-to-speech', methods=['POST']) def text_to_speech_api(): try: text = request.form.get('text') language = request.form.get('language') speaker_wav_file = request.files['speaker_wav'] output_path = '/data/ai-tools/voice_cloning/output.wav' # Update this with the actual path output_file = text_to_speech(text, speaker_wav_file, language, output_path) return send_file(output_file) except Exception as e: return str(e), 500
Expected behavior
No response
Logs
Environment
Additional context
No response