This is the Backend for MedVoice project. This includes the ML pipeline for Whisper-Diarization, Llama and Picovoice models.
To build the project locally, follow the steps below:
Note: This README
will assume that your machine is UNIX-based. Please find the equivalent command if you are running on a Windows machine.
-
Clone the repository to your local machine:
git clone https://github.com/MedVoice-RMIT-CapStone-2024/MedVoice-FastAPI.git
-
Install
make
command:
- On Ubuntu or other Debian-based systems, you can use
apt-get
:sudo apt-get install make
- Install the project dependencies using
make
:make setup
- In your local environment, remove the
-placeholder.txt
from.env
andngrok.yml
for the neccessary dependencies.
- Check for missing dependencies and files:
make check
You should install the missing dependencies and files accordingly
-
Run the project locally:
poe compose # or poe compose2
-
[Optional] More ultility options:
- From
poetry.lock
torequirements.txt
poe export
- From
requirements.txt
topoetry.lock
poe import
- To remove all the files from
audios/
andoutputs/
:poe flush
To start all services defined in a docker-compose.yml
file, navigate to the directory containing the file and use the following command:
docker-compose build --no-cache
docker-compose up --build
To use the Replicate API, you need to obtain an API key. Follow the steps below to get your API key:
-
Visit the Replicate website at https://www.replicate.ai and sign in to your account.
-
Navigate to your account settings and locate the API key section.
-
Generate a new API key and copy it to your clipboard.
-
In your project, create a file named
.env
in the root directory. -
Add the following line to the
.env
file, replacing<YOUR_API_KEY>
with your actual API key:REPLICATE_API_KEY=<YOUR_API_KEY>
or your can run this command in your terminal:
export REPLICATE_API_KEY=<YOUR_API_KEY>
When interacting with Google Cloud Client libraries, the library can auto-detect the credentials to use. Make sure to follow these additional steps:
1. Set up Application Default Credentials (ADC) as described in the Google Cloud documentation.
To provide your user credentials to ADC for a Google Account, you use the Google Cloud CLI:
When you initialize the gcloud CLI, be sure to specify a Google Cloud project in which you have permission to access the resources your application needs.
- Create your credential file:
gcloud auth application-default login
- A sign-in screen appears. After you sign in, your credentials are stored in the local credential file used by ADC.
3. Ensure that the user account or service account you are using has the required permissions. For this sample, you must have the "storage.buckets.list" permission.
Args:
project_id: The project id of your Google Cloud project.
Run the following command to find your ngrok configuration file:
ngrok config check
For more information on the ngrok configuration, refer to Ngrok Configuration.
This project is licensed under the MIT License.