Update README.md
Browse files
README.md
CHANGED
|
@@ -63,17 +63,32 @@ The model was evaluated on a dataset containing **67,882 examples**. The evaluat
|
|
| 63 |
- **Eval Samples per Second**: 7.099
|
| 64 |
- **Eval Steps per Second**: 0.887
|
| 65 |
|
|
|
|
|
|
|
| 66 |
## Usage Example
|
| 67 |
To use the model for **text generation** in Turkish, you can load it with the `transformers` library like so:
|
| 68 |
|
| 69 |
```python
|
| 70 |
-
from transformers import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 71 |
|
| 72 |
-
model =
|
| 73 |
-
tokenizer = LlamaTokenizer.from_pretrained("newmindai/Llama-3.3-70B-Instruct-Instruct-V3")
|
| 74 |
|
| 75 |
-
|
| 76 |
-
inputs = tokenizer(input_text, return_tensors="pt")
|
| 77 |
-
outputs = model.generate(inputs["input_ids"], max_length=50)
|
| 78 |
|
| 79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
- **Eval Samples per Second**: 7.099
|
| 64 |
- **Eval Steps per Second**: 0.887
|
| 65 |
|
| 66 |
+
Final performance was benchmarked using the [Mezura🥇](https://huggingface.co/spaces/newmindai/Mezura) framework — a standardized evaluation suite developed by NewmindAI for structured Turkish NLP tasks.
|
| 67 |
+
|
| 68 |
## Usage Example
|
| 69 |
To use the model for **text generation** in Turkish, you can load it with the `transformers` library like so:
|
| 70 |
|
| 71 |
```python
|
| 72 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 73 |
+
from peft import PeftModel
|
| 74 |
+
import torch
|
| 75 |
+
|
| 76 |
+
base_model_id = "meta-llama/Meta-Llama-3-70B-Instruct"
|
| 77 |
+
adapter_id = "newmindai/Llama-3.3-70b-Instruct"
|
| 78 |
+
|
| 79 |
+
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
|
| 80 |
+
|
| 81 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 82 |
+
base_model_id,
|
| 83 |
+
torch_dtype=torch.float16,
|
| 84 |
+
device_map="auto"
|
| 85 |
+
)
|
| 86 |
|
| 87 |
+
model = PeftModel.from_pretrained(base_model, adapter_id)
|
|
|
|
| 88 |
|
| 89 |
+
prompt = "Tarhana en çok hangi il ile özdeşleşmiştir?"
|
|
|
|
|
|
|
| 90 |
|
| 91 |
+
# Inference
|
| 92 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 93 |
+
outputs = model.generate(**inputs, max_new_tokens=100)
|
| 94 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|