Update README.md
Browse files
README.md
CHANGED
@@ -38,8 +38,30 @@ Fantastica-7b-Instruct-0.2-Italian is an Italian speaking, instruction finetuned
|
|
38 |
|
39 |
# PROMPT FORMAT
|
40 |
|
|
|
|
|
41 |
\<s\>[INST]{instruction}[/INST]
|
42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
# Examples:
|
45 |
|
|
|
38 |
|
39 |
# PROMPT FORMAT
|
40 |
|
41 |
+
Your prompt should be surrounded by `[INST]` and `[/INST]` tokens. The very first instruction should begin with a begin of sentence \<s\>. The next instructions should not.
|
42 |
+
|
43 |
\<s\>[INST]{instruction}[/INST]
|
44 |
|
45 |
+
for few-shots prompt use:
|
46 |
+
|
47 |
+
<s>[INST]{instruction}[/INST]{response}[INST]{instruction2}[/INST]
|
48 |
+
|
49 |
+
# Python
|
50 |
+
|
51 |
+
```python
|
52 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
53 |
+
|
54 |
+
model = AutoModelForCausalLM.from_pretrained("scribis/Fantastica-7b-Instruct-0.2-Italian_merged")
|
55 |
+
tokenizer = AutoTokenizer.from_pretrained("scribis/Fantastica-7b-Instruct-0.2-Italian_merged")
|
56 |
+
|
57 |
+
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=768, temperature=0.75, repetition_penalty=1.2, do_sample=True)
|
58 |
+
|
59 |
+
prompt = "<s>[INST]@Scribis @Italiano. Raccontami la trama di un romanzo storico.[/INST]### Titolo: Il figlio dell\'imperatore. ### Introduzione: Il figlio dell\'imperatore (The Son of the Emperor) è un romanzo storico del 1915 scritto da Charles Giblin, ambientato nell\'Antica Roma. ### Trama."
|
60 |
+
result = pipe(prompt)
|
61 |
+
print(result)
|
62 |
+
|
63 |
+
```
|
64 |
+
|
65 |
|
66 |
# Examples:
|
67 |
|