This is the backend for the MedVoice project, which includes the ML pipeline for Whisper-Diarization, Llama3 models, and others LLMs.
MedVoice is a Mobile Application that supports coverting Speech to Medical Documentation format in real-time!
- This
README
assumes that your machine is Debian-based. Please find the equivalent commands if you are running on a Windows machine or other OS. - This
README
assumes that your machine has enough GPU resources to runnomic-embed-text
Ollama model. Please find the equivalent GPU Cloud Instance if your local does not have enough resources. - Make sure that you have turn off your VPN.
To build the project locally, follow the steps below:
Ensure the following dependencies are installed on your machine:
- Python 3
- Docker
- Docker Compose
- For remote access: using
ngrok
command make
command- Optional for Debian-based GPU:
make nvidia
-
Clone the repository to your local machine:
git clone https://github.com/MedVoice-RMIT-CapStone-2024/MedVoice-FastAPI.git cd MedVoice-FastAPI
-
Install
make
command (if not already installed): -
Check for missing dependencies and configuration files:
make check
Resolve any missing dependencies or files as indicated in the output with Step 4
-
For Debian-based OS, set up the Python virtual environment and install dependencies:
make venv-all
-
Choose your deployment mode:
a. For local development:
- In
app/core/app_config.py
, ensureON_LOCALHOST
is set to 1:ON_LOCALHOST = 1
b. For remote access (using ngrok):
- In
app/core/app_config.py
, ensureON_LOCALHOST
is set to 0:ON_LOCALHOST = 0
- Before running the command below, ensure you have a
.env
file in the root directory with the following variables:NGROK_AUTH_TOKEN=your-auth-token NGROK_API_KEY=your-api-key (not API ID) NGROK_EDGE=your-edge-label NGROK_TUNNEL=your-tunnel-name
- Run the following command:
make ngrok
- In
-
Run the project with docker compose
- If you are using a GPU/CPU, run the following command:
# For GPU make GPU=true up # For CPU make GPU=false up
- [Optional] Additional utility options:
- Export dependencies from
poetry.lock
torequirements.txt
:poe export
- Import dependencies from
requirements.txt
topoetry.lock
:poe import
To use the Replicate API, follow these steps:
- Visit the Replicate website at https://www.replicate.ai and #.
- Generate a new API key in your account settings.
- Add the API key to the
.env
file:REPLICATE_API_KEY=<YOUR_API_KEY>
See docs/how-to-setup guide for reference
Run the following command to verify your ngrok configuration file:
ngrok config check
Use the make ngrok
command to generate the configuration file automatically.
For more details on ngrok configuration, see the Ngrok Documentation.
This project is licensed under the GNU GENERAL PL License.