Instructions to use danhtran2mind/Llama-3.2-1B-Instruct-Vi-Medical-LoRA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use danhtran2mind/Llama-3.2-1B-Instruct-Vi-Medical-LoRA with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3.2-1b-instruct-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "danhtran2mind/Llama-3.2-1B-Instruct-Vi-Medical-LoRA") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Unsloth Studio
How to use danhtran2mind/Llama-3.2-1B-Instruct-Vi-Medical-LoRA with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for danhtran2mind/Llama-3.2-1B-Instruct-Vi-Medical-LoRA to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for danhtran2mind/Llama-3.2-1B-Instruct-Vi-Medical-LoRA to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for danhtran2mind/Llama-3.2-1B-Instruct-Vi-Medical-LoRA to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="danhtran2mind/Llama-3.2-1B-Instruct-Vi-Medical-LoRA", max_seq_length=2048, )
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
base_model:
|
|
|
|
| 3 |
library_name: peft
|
| 4 |
model_name: Llama-3.2-1B-it-Medical-LoRA
|
| 5 |
tags:
|
|
@@ -8,6 +9,11 @@ tags:
|
|
| 8 |
- trl
|
| 9 |
- sft
|
| 10 |
licence: license
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
# Model Card for Llama-3.2-1B-it-Medical-LoRA
|
|
@@ -20,7 +26,22 @@ It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
| 20 |
|
| 21 |
This model was trained with SFT.
|
| 22 |
|
| 23 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
```python
|
| 25 |
import torch
|
| 26 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model:
|
| 3 |
+
- meta-llama/Llama-3.2-1B-Instruct
|
| 4 |
library_name: peft
|
| 5 |
model_name: Llama-3.2-1B-it-Medical-LoRA
|
| 6 |
tags:
|
|
|
|
| 9 |
- trl
|
| 10 |
- sft
|
| 11 |
licence: license
|
| 12 |
+
license: mit
|
| 13 |
+
datasets:
|
| 14 |
+
- tmnam20/ViMedAQA
|
| 15 |
+
language:
|
| 16 |
+
- vi
|
| 17 |
---
|
| 18 |
|
| 19 |
# Model Card for Llama-3.2-1B-it-Medical-LoRA
|
|
|
|
| 26 |
|
| 27 |
This model was trained with SFT.
|
| 28 |
|
| 29 |
+
## Usage
|
| 30 |
+
|
| 31 |
+
### HuggingFace Authentication
|
| 32 |
+
```python
|
| 33 |
+
import os
|
| 34 |
+
from huggingface_hub import login
|
| 35 |
+
|
| 36 |
+
# Set the Hugging Face API token
|
| 37 |
+
os.environ["HUGGINGFACEHUB_API_TOKEN"] = "<your_huggingface_token>"
|
| 38 |
+
|
| 39 |
+
# # Initialize API
|
| 40 |
+
login(os.environ.get("HUGGINGFACEHUB_API_TOKEN"))
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
### Inference
|
| 44 |
+
|
| 45 |
```python
|
| 46 |
import torch
|
| 47 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|