Anna Sun
commited on
Commit
·
a95bed7
1
Parent(s):
c0d12b4
update READMEs
Browse files- README.md +46 -2
- seamless_server/README.md +0 -72
README.md
CHANGED
|
@@ -6,7 +6,51 @@ colorTo: yellow
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
suggested_hardware: t4-medium
|
| 9 |
-
duplicated_from: facebook/seamless_m4t
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
sdk: docker
|
| 7 |
pinned: false
|
| 8 |
suggested_hardware: t4-medium
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Seamless Streaming demo
|
| 12 |
+
## Running on HF spaces
|
| 13 |
+
You can simply duplicate the space to run it.
|
| 14 |
+
|
| 15 |
+
## Running locally
|
| 16 |
+
### Install backend seamless_server dependencies
|
| 17 |
+
|
| 18 |
+
`cd seamless-experiences/seamless_vc/seamless_server`
|
| 19 |
+
|
| 20 |
+
If running for the first time, create conda environment:
|
| 21 |
+
```
|
| 22 |
+
conda create --name smlss_server python=3.8
|
| 23 |
+
conda activate smlss_server
|
| 24 |
+
pip install -r requirements.txt
|
| 25 |
+
```
|
| 26 |
+
|
| 27 |
+
### Install frontend streaming-react-app dependencies
|
| 28 |
+
```
|
| 29 |
+
conda install -c conda-forge nodejs
|
| 30 |
+
cd streaming-react-app
|
| 31 |
+
npm install
|
| 32 |
+
npm run build # this will create the dist/ folder
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
### Running the server
|
| 37 |
+
|
| 38 |
+
The server can be run locally with uvicorn below.
|
| 39 |
+
Run the server in dev mode:
|
| 40 |
+
|
| 41 |
+
```
|
| 42 |
+
uvicorn app_pubsub:app --reload --host localhost
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
Run the server in prod mode:
|
| 46 |
+
|
| 47 |
+
```
|
| 48 |
+
uvicorn app_pubsub:app --host 0.0.0.0
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
To enable additional logging from uvicorn pass `--log-level debug` or `--log-level trace`.
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
### Debuging
|
| 55 |
+
|
| 56 |
+
If you enable "Server Debug Flag" when starting streaming from the client, this enables extensive debug logging and it saves audio files in /debug folder.
|
seamless_server/README.md
DELETED
|
@@ -1,72 +0,0 @@
|
|
| 1 |
-
# Seamless Streaming Server
|
| 2 |
-
|
| 3 |
-
## Setting up the AWS server
|
| 4 |
-
|
| 5 |
-
- Clone working AMI with things set up: https://us-west-2.console.aws.amazon.com/ec2/home?region=us-west-2#ImageDetails:imageId=ami-013fc3fb27faa03e5
|
| 6 |
-
- This has the conda environment, repository, model etc set up so minimal install was required
|
| 7 |
-
|
| 8 |
-
- Open port tunnelling via ssh so you can connect to the AWS server via localhost (gets around some security issues): e.g. `ssh -L 8000:localhost:8000 -L 3000:localhost:3000 -L 5173:localhost:5173 -i ~/.ssh/mduppes_devserver.pem [email protected]`
|
| 9 |
-
|
| 10 |
-
## Setting up the dev environment
|
| 11 |
-
|
| 12 |
-
Clone the repo
|
| 13 |
-
|
| 14 |
-
`cd seamless-experiences/seamless_vc/seamless_server`
|
| 15 |
-
|
| 16 |
-
If running for the first time, create conda environment from the environment.yaml `conda env create -f environment.yml`
|
| 17 |
-
(or if you are on Mac OS, replace `environment.yml` with `environment_mac.yml`)
|
| 18 |
-
|
| 19 |
-
In each new terminal you use you will need to activate the conda environment:
|
| 20 |
-
`conda activate smlss_server`
|
| 21 |
-
|
| 22 |
-
Install dependencies with pip:
|
| 23 |
-
`pip install -r requirements.txt`
|
| 24 |
-
|
| 25 |
-
Install Meta-specific dependencies with the dedicated install script:
|
| 26 |
-
`./scripts/update_meta_dependencies.sh`
|
| 27 |
-
|
| 28 |
-
If needed, download and extract the latest model using the dedicated script:
|
| 29 |
-
`./scripts/download_latest_models.sh`
|
| 30 |
-
|
| 31 |
-
## Setting up the docker environment
|
| 32 |
-
|
| 33 |
-
Alternatively we can build a docker image (for ease of deployment).
|
| 34 |
-
|
| 35 |
-
1. Make sure github keys are loaded into ssh-agent. Copy over the keys into ~/.ssh/ then run `eval $(ssh-agent)`, then `ssh-add` to load the keys.
|
| 36 |
-
2. Run `docker-compose build` if you just want to build the image. If you want to also run the server: `docker compose up --build`.
|
| 37 |
-
3. Optionally to push the built docker image to ECR so it could be pulled into deployments: `./deploy.sh`
|
| 38 |
-
|
| 39 |
-
NOTE: Add your models to the ./models directory.
|
| 40 |
-
|
| 41 |
-
# Running the v2 ("pubsub") server
|
| 42 |
-
|
| 43 |
-
The pubsub server can be loaded with docker above or run locally with uvicorn below.
|
| 44 |
-
Run the server in dev mode:
|
| 45 |
-
|
| 46 |
-
```
|
| 47 |
-
uvicorn app_pubsub:app --reload
|
| 48 |
-
```
|
| 49 |
-
|
| 50 |
-
Run the server in prod mode:
|
| 51 |
-
|
| 52 |
-
```
|
| 53 |
-
uvicorn app_pubsub:app --host 0.0.0.0
|
| 54 |
-
```
|
| 55 |
-
|
| 56 |
-
To enable additional logging from uvicorn pass `--log-level debug` or `--log-level trace`.
|
| 57 |
-
|
| 58 |
-
## Running the frontend
|
| 59 |
-
|
| 60 |
-
- For the v2 pubsub server, the frontend lives in the streaming-react-app root directory (not seamless_ui).
|
| 61 |
-
|
| 62 |
-
## Updating the conda environment after changes to environment.yml
|
| 63 |
-
|
| 64 |
-
Run this command to install/remove packages to match the current environment.yml file:
|
| 65 |
-
|
| 66 |
-
`conda env update --prefix ./env --file environment.yml --prune`
|
| 67 |
-
|
| 68 |
-
See: https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html?highlight=sharing#updating-an-environment
|
| 69 |
-
|
| 70 |
-
## Debuging
|
| 71 |
-
|
| 72 |
-
If you enable "Server Debug Flag" when starting streaming from the client, this enables extensive debug logging and it saves audio files in /debug folder. test_no_silence.wav contains data with silence chunks removed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|