daswer123 / xtts-api-server

A simple FastAPI Server to run XTTSv2
MIT License
292 stars 67 forks source link

Error while using streaming mode #46

Closed Haurrus closed 5 months ago

Haurrus commented 5 months ago

Here is my conf of server.py :

DEVICE = os.getenv('DEVICE',"cuda") OUTPUT_FOLDER = os.getenv('OUTPUT', 'output') SPEAKER_FOLDER = os.getenv('SPEAKER', 'speakers') MODEL_FOLDER = os.getenv('MODEL', 'models') BASE_HOST = os.getenv('BASE_URL', '127.0.0.1:8020') BASE_URL = os.getenv('BASE_URL', '127.0.0.1:8020') MODEL_SOURCE = os.getenv("MODEL_SOURCE", "local") MODEL_VERSION = os.getenv("MODEL_VERSION","v2.0.2") LOWVRAM_MODE = os.getenv("LOWVRAM_MODE") == 'true' DEEPSPEED = os.getenv("DEEPSPEED") == 'true' USE_CACHE = os.getenv("USE_CACHE") == 'true'

STREAM_MODE = os.getenv("STREAM_MODE") == 'true' STREAM_MODE_IMPROVE = os.getenv("STREAM_MODE_IMPROVE") == 'false' STREAM_PLAY_SYNC = os.getenv("STREAM_PLAY_SYNC") == 'false'

and here's the request.py I make :

import requests

tts_url = 'http://127.0.0.1:8020/tts_stream/' tts_response = requests.post(tts_url, json={ "text": " Greetings, traveler. What brings you to Whiterun? I hope you're here for noble reasons, as our Jarl takes great care in ensuring his palace is free from harm.", "speaker_wav": "D:/Modelisation_IA/xtts-api-server-custom/models/MrHaurrus/test.wav", "language": "en", })

here's the result ouput :

(venv) PS D:\Modelisation_IA\xtts-api-server-main\xtts_api_server> python server.py 2024-01-19 12:33:53.248 | INFO | main::72 - Model: 'v2.0.2' starts to load,wait until it loads 2024-01-19 12:33:59.905 | INFO | tts_funcs:load_model:190 - Pre-create latents for all current speakers 2024-01-19 12:33:59.906 | INFO | tts_funcs:create_latents_for_all:270 - Latents created for all 0 speakers. 2024-01-19 12:33:59.907 | INFO | tts_funcs:load_model:193 - Model successfully loaded D:\Modelisation_IA\xtts-api-server-main\xtts_api_server\venv\Lib\site-packages\pydantic_internal_fields.py:149: UserWarning: Field "modelname" has conflict with protected namespace "model".

You may be able to resolve this warning by setting model_config['protected_namespaces'] = (). warnings.warn( INFO: Started server process [47132] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8020 (Press CTRL+C to quit) INFO: 127.0.0.1:50160 - "POST /tts_stream/ HTTP/1.1" 307 Temporary Redirect INFO: 127.0.0.1:50160 - "POST /tts_stream HTTP/1.1" 405 Method Not Allowed

Haurrus commented 5 months ago

I'm stupid it's a "get" request for tts_stream and I use a post one.