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 UNIX-based. Please find the equivalent commands if you are running on a Windows machine. - This
README
assumes that your machine has enough GPU resources to run Llama3. Please find the equivalent GPU Cloud Instance if your local does not have enough resources.
To build the project locally, follow the steps below:
Ensure the following dependencies are installed on your machine:
- Python 3
- Docker
- Docker Compose
ngrok
commandmake
commandubuntu-drivers autoinstall
[Optional for GPU]
-
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.
-
Set up the Python virtual environment and install dependencies:
make venv-all
-
Set up ngrok configuration:
- Before running the command, 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
- Run the project with docker compose
- If you are using a GPU, run the following command:
make GPU=true up
- Otherwise, run the following command, which will run the project without Ollama Llama3 support:
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 sign in.
- 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 MIT License.