Translation
PEFT
Safetensors
Zulu
English
african-languages
scientific-translation
afriscience-mt
lora
llama
Instructions to use dsfsi/llama_3.1_8b_instruct-lora-r4-zul-eng with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use dsfsi/llama_3.1_8b_instruct-lora-r4-zul-eng with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-3.1-8B-Instruct") model = PeftModel.from_pretrained(base_model, "dsfsi/llama_3.1_8b_instruct-lora-r4-zul-eng") - Notebooks
- Google Colab
- Kaggle
Update example model/adapter paths to dsfsi namespace
Browse files
README.md
CHANGED
|
@@ -18,7 +18,7 @@ pipeline_tag: translation
|
|
| 18 |
|
| 19 |
# llama_3.1_8b_instruct-lora-r4-zul-eng
|
| 20 |
|
| 21 |
-
[](https://huggingface.co/
|
| 22 |
|
| 23 |
This is a **LoRA adapter** for the AfriScience-MT project, enabling efficient scientific machine translation for African languages.
|
| 24 |
|
|
@@ -77,7 +77,7 @@ base_model = AutoModelForCausalLM.from_pretrained(
|
|
| 77 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
|
| 78 |
|
| 79 |
# Load LoRA adapter
|
| 80 |
-
adapter_name = "
|
| 81 |
model = PeftModel.from_pretrained(base_model, adapter_name)
|
| 82 |
model.eval()
|
| 83 |
|
|
@@ -121,7 +121,7 @@ base_model = AutoModelForCausalLM.from_pretrained(
|
|
| 121 |
device_map="auto",
|
| 122 |
torch_dtype=torch.bfloat16,
|
| 123 |
)
|
| 124 |
-
model = PeftModel.from_pretrained(base_model, "
|
| 125 |
```
|
| 126 |
|
| 127 |
## Training Details
|
|
|
|
| 18 |
|
| 19 |
# llama_3.1_8b_instruct-lora-r4-zul-eng
|
| 20 |
|
| 21 |
+
[](https://huggingface.co/dsfsi/llama_3.1_8b_instruct-lora-r4-zul-eng)
|
| 22 |
|
| 23 |
This is a **LoRA adapter** for the AfriScience-MT project, enabling efficient scientific machine translation for African languages.
|
| 24 |
|
|
|
|
| 77 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.1-8B-Instruct")
|
| 78 |
|
| 79 |
# Load LoRA adapter
|
| 80 |
+
adapter_name = "dsfsi/llama_3.1_8b_instruct-lora-r4-zul-eng"
|
| 81 |
model = PeftModel.from_pretrained(base_model, adapter_name)
|
| 82 |
model.eval()
|
| 83 |
|
|
|
|
| 121 |
device_map="auto",
|
| 122 |
torch_dtype=torch.bfloat16,
|
| 123 |
)
|
| 124 |
+
model = PeftModel.from_pretrained(base_model, "dsfsi/llama_3.1_8b_instruct-lora-r4-zul-eng")
|
| 125 |
```
|
| 126 |
|
| 127 |
## Training Details
|