Skip to content

Commit

Permalink
finetuning neuralchat-7b using intel(r) extension for transformers an…
Browse files Browse the repository at this point in the history
…d workflow interface (#907)

* implementation of neuralchat-7b finetuning using itrex and openfl

Signed-off-by: kta-intel <[email protected]>

* enabling support for itrex-neuralchat with openfl workflow-interface

Signed-off-by: kta-intel <[email protected]>

* updated model and description

Signed-off-by: kta-intel <[email protected]>

* fix colab link and add citation

Signed-off-by: kta-intel <[email protected]>

* add readme and additional setup and preprocess steps

Signed-off-by: kta-intel <[email protected]>

* fix preprocess step

Signed-off-by: kta-intel <[email protected]>

* modify readme, fix preprocess_dataset.py, add setup steps in notebook

Signed-off-by: kta-intel <[email protected]>

* fix lint issues

Signed-off-by: kta-intel <[email protected]>

* remove whitespace in preprocess_data.py

Signed-off-by: kta-intel <[email protected]>

* removed some extra torch.saves that were being used for debugging

Signed-off-by: kta-intel <[email protected]>

* deleted new requirements.txt files and modified setup instructions to point toward original requirements.txt

Signed-off-by: kta-intel <[email protected]>

* fix typo in notebook

Signed-off-by: kta-intel <[email protected]>

* fix typo in notebook

Signed-off-by: kta-intel <[email protected]>

---------

Signed-off-by: kta-intel <[email protected]>
  • Loading branch information
kta-intel authored Feb 23, 2024
1 parent 9e9047f commit 8e69760
Show file tree
Hide file tree
Showing 3 changed files with 791 additions and 0 deletions.
29 changes: 29 additions & 0 deletions openfl-tutorials/experimental/LLM/neuralchat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# **Workflow Interface:** Fine-tuning neural-chat-7b-v3 using Intel(R) Extension for Transformers and OpenFL

## 1. About the dataset

We will be fine-tuning our model on the Medical Question Answering Dataset ([MedQuAD](https://github.com/abachaa/MedQuAD)). It is an open-source dataset comprised of medical question-answer pairs scrapped from various NIH websites.

## 2. About the model

Intel's [Neural-Chat-v3](https://huggingface.co/Intel/neural-chat-7b-v3) is a fine-tuned 7B parameter LLM from [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1) on the open source dataset [Open-Orca/SlimOrca](https://huggingface.co/datasets/Open-Orca/SlimOrca).

Additional details in the fine-tuning can be found [here](https://medium.com/intel-analytics-software/the-practice-of-supervised-finetuning-and-direct-preference-optimization-on-habana-gaudi2-a1197d8a3cd3).

## 3. Running the tutorial

Follow along step-by-step in the [notebook](Workflow_Interface_NeuralChat.ipynb) to learn how to fine-tune neural-chat-7b on the MedQuAD dataset

## Reference:
```
@ARTICLE{BenAbacha-BMC-2019,
author = {Asma {Ben Abacha} and Dina Demner{-}Fushman},
title = {A Question-Entailment Approach to Question Answering},
journal = {{BMC} Bioinform.},
volume = {20},
number = {1},
pages = {511:1--511:23},
year = {2019},
url = {https://bmcbioinformatics.biomedcentral.com/articles/10.1186/s12859-019-3119-4}
}
```
Loading

0 comments on commit 8e69760

Please sign in to comment.