Update README.md
Browse files
README.md
CHANGED
|
@@ -23,4 +23,45 @@ datasets:
|
|
| 23 |
|
| 24 |
This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
| 25 |
|
| 26 |
-
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
|
| 25 |
|
| 26 |
+
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
## Usage Examples
|
| 30 |
+
|
| 31 |
+
```python
|
| 32 |
+
|
| 33 |
+
# Load model directly
|
| 34 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 35 |
+
|
| 36 |
+
tokenizer = AutoTokenizer.from_pretrained("umarigan/LLama-3-8B-Instruction-tr")
|
| 37 |
+
model = AutoModelForCausalLM.from_pretrained("umarigan/LLama-3-8B-Instruction-tr")
|
| 38 |
+
alpaca_prompt = """
|
| 39 |
+
Görev:
|
| 40 |
+
{}
|
| 41 |
+
|
| 42 |
+
Girdi:
|
| 43 |
+
{}
|
| 44 |
+
|
| 45 |
+
Cevap:
|
| 46 |
+
{}"""
|
| 47 |
+
|
| 48 |
+
inputs = tokenizer(
|
| 49 |
+
[
|
| 50 |
+
alpaca_prompt.format(
|
| 51 |
+
"bir haftada 3 kilo verebileceğim 5 öneri sunabilir misin?", # Görev
|
| 52 |
+
"", # Girdi
|
| 53 |
+
"", # Cevap - boş bırakın!
|
| 54 |
+
)
|
| 55 |
+
], return_tensors = "pt")
|
| 56 |
+
outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True)
|
| 57 |
+
tokenizer.batch_decode(outputs)
|
| 58 |
+
|
| 59 |
+
Output:
|
| 60 |
+
<|begin_of_text|> Görev: bir haftada 3 kilo verebileceğim 5 öneri sunabilir misin?
|
| 61 |
+
|
| 62 |
+
Girdi:
|
| 63 |
+
|
| 64 |
+
Cevap:
|
| 65 |
+
|
| 66 |
+
1. Yemeklerinizde daha az tuz kullanın. 2. Daha fazla sebze ve meyve tüketin. 3. Daha fazla su için. 4. Daha fazla egzersiz yapın. 5. Daha fazla uyku alın.<|end_of_text|>
|
| 67 |
+
```
|