move tts and stt to 9001 and 9002
This commit is contained in:
parent
0c6a2cde30
commit
f989731c08
|
@ -129,7 +129,7 @@ We recommend having Docker installed for the easiest setup. Local TTS and STT re
|
|||
|
||||
#### Local TTS
|
||||
1. Clone the [openedai-speech](https://github.com/matatonic/openedai-speech?tab=readme-ov-file) repository
|
||||
2. Follow the Docker Image instructions for your system. Default run `docker compose -f docker-compose.min.yml up` in the root.
|
||||
2. Follow the Docker Image instructions for your system. Default run `docker compose -f docker-compose.min.yml up --publish 9001:8000` in the root.
|
||||
3. Set your profile with local TTS service
|
||||
```python
|
||||
interpreter.tts = "local"
|
||||
|
@ -138,7 +138,7 @@ interpreter.tts = "local"
|
|||
#### Local STT
|
||||
1. Clone the [faster-whisper-server](https://github.com/fedirz/faster-whisper-server) repository
|
||||
2. Follow the Docker Compose Quick Start instructions for your respective system.
|
||||
3. Run `docker run --publish 8001:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER__MODEL=Systran/faster-whisper-small --detach fedirz/faster-whisper-server:latest-cpu` to publish to port 8001 instead of the default 8000 (since our TTS uses this port).
|
||||
3. Run `docker run --publish 9002:8000 --volume ~/.cache/huggingface:/root/.cache/huggingface --env WHISPER__MODEL=Systran/faster-whisper-small --detach fedirz/faster-whisper-server:latest-cpu` to publish to port 8001 instead of the default 8000 (since our TTS uses this port).
|
||||
4. Set your profile with local STT service
|
||||
```python
|
||||
interpreter.stt = "local"
|
||||
|
|
|
@ -180,16 +180,22 @@ def run(
|
|||
threads.append(server_thread)
|
||||
|
||||
if server == "livekit":
|
||||
|
||||
|
||||
### LIVEKIT SERVER
|
||||
def run_command(command):
|
||||
i = 0
|
||||
while True:
|
||||
process = subprocess.run(command, shell=True, check=True, preexec_fn=os.setsid)
|
||||
print("i is: ", i)
|
||||
if i > 0:
|
||||
process = subprocess.run(command, shell=True, check=True, preexec_fn=os.setsid)
|
||||
else:
|
||||
print("Skipping server start (first iteration)")
|
||||
|
||||
url = f"http://{server_host}:{server_port}"
|
||||
while True:
|
||||
time.sleep(5)
|
||||
try:
|
||||
print("Checking server status... with i = ", i)
|
||||
response = requests.get(url)
|
||||
if response.status_code == 200:
|
||||
continue
|
||||
|
@ -201,10 +207,14 @@ def run(
|
|||
break
|
||||
|
||||
print("Server failed to start, retrying...")
|
||||
|
||||
try:
|
||||
os.killpg(os.getpgid(process.pid), signal.SIGTERM)
|
||||
os.killpg(os.getpgid(process.pid), signal.SIGTERM) # This will fail when i=0
|
||||
except ProcessLookupError:
|
||||
pass # Process group already terminated
|
||||
pass
|
||||
|
||||
i += 1
|
||||
|
||||
|
||||
# Start the livekit server
|
||||
if debug:
|
||||
|
|
Loading…
Reference in New Issue