mirror of
https://github.com/remsky/Kokoro-FastAPI.git
synced 2025-04-13 09:39:17 +00:00
Update README.md
Fixes the open ai code to ensure it points to /v1
This commit is contained in:
parent
02292665c8
commit
418307d4a2
1 changed files with 4 additions and 4 deletions
|
@ -34,7 +34,7 @@ The service can be accessed through either the API endpoints or the Gradio web i
|
|||
```python
|
||||
from openai import OpenAI
|
||||
client = OpenAI(
|
||||
base_url="http://localhost:8880",
|
||||
base_url="http://localhost:8880/v1",
|
||||
api_key="not-needed"
|
||||
)
|
||||
|
||||
|
@ -59,7 +59,7 @@ The service can be accessed through either the API endpoints or the Gradio web i
|
|||
```python
|
||||
# Using OpenAI's Python library
|
||||
from openai import OpenAI
|
||||
client = OpenAI(base_url="http://localhost:8880", api_key="not-needed")
|
||||
client = OpenAI(base_url="http://localhost:8880/v1", api_key="not-needed")
|
||||
response = client.audio.speech.create(
|
||||
model="kokoro", # Not used but required for compatibility, also accepts library defaults
|
||||
voice="af_bella+af_sky",
|
||||
|
@ -96,8 +96,8 @@ with open("output.mp3", "wb") as f:
|
|||
|
||||
Quick tests (run from another terminal):
|
||||
```bash
|
||||
python examples/test_openai_tts.py # Test OpenAI Compatibility
|
||||
python examples/test_all_voices.py # Test all available voices
|
||||
python examples/assorted_checks/test_openai/test_openai_tts.py # Test OpenAI Compatibility
|
||||
python examples/assorted_checks/test_voices/test_all_voices.py # Test all available voices
|
||||
```
|
||||
</details>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue