This README provides a concise guide to understanding and reproducing the steps involved in the deep learning project focused on fine-tuning the medllama2 model for performing differential diagnosis, utilizing the DDXPlus dataset. Below are the outlined steps and file structures:
- 
Data Description: The DDXPlus dataset is stored in the
ddxplus-datasetfolder inside the parentDatasetdirectory. It consists of the following files:release_condition.jsonrelease_evidences.jsontest.csv
 - 
Conversion to Human-Readable Text: The dataset was converted into a more human-readable format stored in
cases.jsonusingddx_data_to_cases.py. This 'cases.json' file consists of 20k samples taken from thetest.csvfile of DDXPlus. - 
Conversational Data Generation: 10k samples from the
cases.jsondata were further transformed into conversational form between a human and an assistant acting as a doctor usinggenerate.py. The resulting conversational data was stored ingenerated_data.csvand subsequently pushed to the Hugging Face repositorysatyam-03/ddx-conversations-10k. 
- Fine-Tuning Script: The fine-tuning process was executed using 
opdx-alpha.py. This script is responsible for fine-tuning themedllama2model over our generated DDX conversational dataset, resulting in the output stored in theModelfolder. 
- Model Conversion: The 
convert-lora-to-ggml.pyscript in thellama.cpprepository, along withadapter_config.jsonandadapter_model.bin, were utilized to convert the fine-tuned model into theggmlformat and generate the model which can be run in inference mode. 
For detailed reference on the above tasks, you can refer to this Medium article.
To run the fine-tuned model, follow these steps:
- Install Ollama: Ensure that Ollama is installed on your device.
curl -fsSL https://ollama.com/install.sh | sh - Start the Ollama server: Run the following command in your terminal:
ollama serve - Build the model from fine-tuned adapter: In a new terminal, navigate to the Model directory and run the following commands:
Wait for the process to finish, then run:
ollama create opdx -f ./Modelfileollama run opdx 
This command will initiate the model, allowing you to perform differential diagnosis using our fine-tuned opdx model in the terminal itself.
- app folder is the backend of the project.
 - stlit folder contains the frontend made using Streamlit.
 
- Install the requirements.txt in UI folder
 - Navigate to the UI/app directory and run 
uvicorn server:appto start the server. - In a new terminal, navigate to the UI/stlit/pages directory and then run 
streamlit run ./Home.py 
You can view the final project presentation here.