Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
language:
|
4 |
+
- el
|
5 |
+
pipeline_tag: text-generation
|
6 |
+
---
|
7 |
+
# Model Description
|
8 |
+
|
9 |
+
This is an instruction tuned model based on the gsar78/GreekLlama-1.1B-base model.
|
10 |
+
The dataset used is 52k row instruction/response pairs all in Greek language
|
11 |
+
|
12 |
+
Notice: The model is for experimental & research purposes.
|
13 |
+
|
14 |
+
# Usage
|
15 |
+
|
16 |
+
To use you can just run the following in a Colab configured with a GPU:
|
17 |
+
|
18 |
+
```python
|
19 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
20 |
+
import transformers
|
21 |
+
import torch
|
22 |
+
|
23 |
+
|
24 |
+
# Load the tokenizer and model
|
25 |
+
tokenizer = AutoTokenizer.from_pretrained("gsar78/GreekLlama-1.1B-it")
|
26 |
+
model = AutoModelForCausalLM.from_pretrained("gsar78/GreekLlama-1.1B-it")
|
27 |
+
|
28 |
+
|
29 |
+
# Check if CUDA is available and move the model to GPU if possible
|
30 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
31 |
+
model.to(device)
|
32 |
+
|
33 |
+
prompt = "Ποιά είναι τα δύο βασικά πράγματα που πρέπει να γνωρίζω για την Τεχνητή Νοημοσύνη:"
|
34 |
+
|
35 |
+
# Tokenize the input prompt
|
36 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(device)
|
37 |
+
|
38 |
+
# Generate the output
|
39 |
+
generation_params = {
|
40 |
+
#"max_new_tokens": 250, # Adjust the number of tokens generated
|
41 |
+
"do_sample": True, # Enable sampling to diversify outputs
|
42 |
+
"temperature": 0.1, # Sampling temperature
|
43 |
+
"top_p": 0.9, # Nucleus sampling
|
44 |
+
"num_return_sequences": 1,
|
45 |
+
}
|
46 |
+
|
47 |
+
output = model.generate(**inputs, **generation_params)
|
48 |
+
|
49 |
+
# Decode the generated text
|
50 |
+
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
51 |
+
|
52 |
+
print("Generated Text:")
|
53 |
+
print(generated_text)
|
54 |
+
```
|