mirror of
https://github.com/remsky/Kokoro-FastAPI.git
synced 2025-08-05 16:48:53 +00:00
Update README.md with new local endpoint usage example
The old method will result in a deprecation warning, this is the recommended method via openAI. ```python @deprecated( "Due to a bug, this method doesn't actually stream the response content, `.with_streaming_response.method()` should be used instead" ) def stream_to_file( ... ```
This commit is contained in:
parent
880fa7ad53
commit
a51ea53b50
1 changed files with 4 additions and 3 deletions
|
@ -56,13 +56,14 @@ The service can be accessed through either the API endpoints or the Gradio web i
|
|||
api_key="not-needed"
|
||||
)
|
||||
|
||||
response = client.audio.speech.create(
|
||||
with client.audio.speech.with_streaming_response.create(
|
||||
model="kokoro",
|
||||
voice="af_sky+af_bella", #single or multiple voicepack combo
|
||||
input="Hello world!",
|
||||
response_format="mp3"
|
||||
)
|
||||
) as response:
|
||||
response.stream_to_file("output.mp3")
|
||||
|
||||
```
|
||||
|
||||
or visit http://localhost:7860
|
||||
|
|
Loading…
Add table
Reference in a new issue