Fly.io example: remove step to cache silero models.
No longer necessary.
This commit is contained in:
@@ -9,8 +9,5 @@ COPY *.py .
|
|||||||
COPY ./requirements.txt requirements.txt
|
COPY ./requirements.txt requirements.txt
|
||||||
RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
|
RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
|
||||||
|
|
||||||
# Install models
|
|
||||||
RUN python3 install_deps.py
|
|
||||||
|
|
||||||
# Start the FastAPI server
|
# Start the FastAPI server
|
||||||
CMD python3 bot_runner.py --port ${FAST_API_PORT}
|
CMD python3 bot_runner.py --port ${FAST_API_PORT}
|
||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
This project modifies the `bot_runner.py` server to launch a new machine for each user session. This is a recommended approach for production vs. running shell processess as your deployment will quickly run out of system resources under load.
|
This project modifies the `bot_runner.py` server to launch a new machine for each user session. This is a recommended approach for production vs. running shell processess as your deployment will quickly run out of system resources under load.
|
||||||
|
|
||||||
To speed up machine boot times, we also download and cache Silero VAD as part of the Dockerfile (`install_deps.py`). If you are using other custom models, you can add them here too.
|
|
||||||
|
|
||||||
For this example, we are using Daily as a WebRTC transport and provisioning a new room and token for each session. You can use another transport, such as WebSockets, by modifying the `bot.py` and `bot_runner.py` files accordingly.
|
For this example, we are using Daily as a WebRTC transport and provisioning a new room and token for each session. You can use another transport, such as WebSockets, by modifying the `bot.py` and `bot_runner.py` files accordingly.
|
||||||
|
|
||||||
## Setting up your fly.io deployment
|
## Setting up your fly.io deployment
|
||||||
@@ -14,7 +12,7 @@ You can copy the `example-fly.toml` as a reference. Be sure to change the app na
|
|||||||
|
|
||||||
### Create your .env file
|
### Create your .env file
|
||||||
|
|
||||||
Copy the base `env.example` to `.env` and enter the necessary API keys.
|
Copy the base `env.example` to `.env` and enter the necessary API keys.
|
||||||
|
|
||||||
`FLY_APP_NAME` should match that in the `fly.toml` file.
|
`FLY_APP_NAME` should match that in the `fly.toml` file.
|
||||||
|
|
||||||
@@ -32,7 +30,6 @@ Note: you can do this manually via the fly.io dashboard under the "secrets" sub-
|
|||||||
|
|
||||||
`fly deploy`
|
`fly deploy`
|
||||||
|
|
||||||
|
|
||||||
## Connecting to your bot
|
## Connecting to your bot
|
||||||
|
|
||||||
Send a post request to your running fly.io instance:
|
Send a post request to your running fly.io instance:
|
||||||
@@ -40,4 +37,3 @@ Send a post request to your running fly.io instance:
|
|||||||
`curl --location --request POST 'https://YOUR_FLY_APP_NAME/start_bot'`
|
`curl --location --request POST 'https://YOUR_FLY_APP_NAME/start_bot'`
|
||||||
|
|
||||||
This request will wait until the machine enters into a `starting` state, before returning the a room URL and token to join.
|
This request will wait until the machine enters into a `starting` state, before returning the a room URL and token to join.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
import torch
|
|
||||||
|
|
||||||
# Download (cache) the Silero VAD model
|
|
||||||
torch.hub.load(repo_or_dir='snakers4/silero-vad', model='silero_vad', force_reload=True)
|
|
||||||
Reference in New Issue
Block a user