Skip to content

Commit

Permalink
feat: add img overview
Browse files Browse the repository at this point in the history
  • Loading branch information
katopz committed Oct 20, 2023
1 parent 2c2a357 commit ba01524
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
Binary file added src/ml/llm-train-finetune/llm-langchain-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 21 additions & 7 deletions src/ml/llm-train-finetune/mod.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,31 @@
# LLM Train and FineTune

- [x] Try [Colab Notebook to Finetuning Mistral-7b-Instruct](https://adithyask.medium.com/a-beginners-guide-to-fine-tuning-mistral-7b-instruct-model-0f39647b20fe): https://github.com/adithya-s-k/CompanionLLM
## Overview

The notebook needs to add `pad_token_id=2` when calling merged_model.generate() in Test the merged model:
![](./llm-langchain-flow.png)

```python
outputs = merged_model.generate(input_ids=input_ids, pad_token_id=2,
max_new_tokens=100, do_sample=True, top_p=0.9,temperature=0.5)
```
> ref: https://github.com/chatchat-space/Langchain-Chatchat/blob/master/README_en.md
Fixed notebook is [Mistral_7B_qLora_Finetuning.ipynb](./Mistral_7B_qLora_Finetuning.ipynb). Prompt formatting is still questioned.
## Brain dump

- [Colab Notebook to Fine-tuning Mistral-7b-Instruct](https://adithyask.medium.com/a-beginners-guide-to-fine-tuning-mistral-7b-instruct-model-0f39647b20fe): https://github.com/adithya-s-k/CompanionLLM

⚠️ This notebook needs to add `pad_token_id=2` when calling merged_model.generate() in Test the merged model:

```python
outputs = merged_model.generate(input_ids=input_ids, pad_token_id=2,
max_new_tokens=100, do_sample=True, top_p=0.9,temperature=0.5)
```

Fixed notebook is [Mistral_7B_qLora_Finetuning.ipynb](./Mistral_7B_qLora_Finetuning.ipynb). Prompt formatting is still questioned.

## TODO

- [ ] Understand pgvector: https://bugbytes.io/posts/vector-databases-pgvector-and-langchain/
- [ ] Try RAG: https://bugbytes.io/posts/retrieval-augmented-generation-with-langchain-and-pgvector/

## TOREAD

- [ ] Read, try and summary: https://github.com/replit/replitLM#alpaca-style-instruct-tuning-with-hugging-face-transformers
- [ ] Try fine-tune-mistral: https://github.com/abacaj/fine-tune-mistral
- [ ] Try fine-tune-mistral: https://github.com/brevdev/notebooks/blob/main/mistral-finetune-own-data.ipynb
Expand All @@ -21,3 +34,4 @@ Fixed notebook is [Mistral_7B_qLora_Finetuning.ipynb](./Mistral_7B_qLora_Finetun
- [ ] Read and summary: https://docs.llamaindex.ai/en/stable/core_modules/data_modules/index/metadata_extraction.html
- [ ] LLaVA: Visual and language AI with GPT-4, instruction tuning to visual data.
- [ ] MUFFIN: follow Scaling Tasks per Input paradigm to collect multiple task instructions for a single input. (Keywords: Instruction Brainstorm, Instruction Rematching)
- [ ] Take a look: https://github.com/chatchat-space/Langchain-Chatchat

0 comments on commit ba01524

Please sign in to comment.