Update README.md
Browse files
README.md
CHANGED
@@ -48,47 +48,55 @@ You can load the model directly from the Hugging Face model hub using
|
|
48 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
49 |
|
50 |
tokenizer = AutoTokenizer.from_pretrained("togethercomputer/Llama-2-7B-32K-Instruct")
|
51 |
-
model = AutoModelForCausalLM.from_pretrained("togethercomputer/Llama-2-7B-32K-Instruct",
|
52 |
-
|
53 |
-
|
|
|
|
|
54 |
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
55 |
```
|
56 |
|
57 |
The model is also hosted on [Together Playground](https://api.together.xyz/playground). You can simply play with the model by using prompt formatted by:
|
58 |
|
59 |
```
|
60 |
-
[INST]
|
61 |
```
|
62 |
|
63 |
For example, if we query the model with
|
64 |
|
65 |
```
|
66 |
-
[INST]
|
67 |
```
|
68 |
|
69 |
the model will return
|
70 |
```
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
```
|
93 |
|
94 |
## Model Evaluation
|
|
|
48 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
49 |
|
50 |
tokenizer = AutoTokenizer.from_pretrained("togethercomputer/Llama-2-7B-32K-Instruct")
|
51 |
+
model = AutoModelForCausalLM.from_pretrained("togethercomputer/Llama-2-7B-32K-Instruct",
|
52 |
+
trust_remote_code=True, torch_dtype=torch.float16)
|
53 |
+
input_ids = tokenizer.encode("[INST]\nWrite a poem about cats\n[/INST]\n\n", return_tensors="pt")
|
54 |
+
output = model.generate(input_ids, max_length=128,
|
55 |
+
temperature=0.7, repetition_panelty=1.1, top_p=0.7, top_k=50)
|
56 |
output_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
57 |
```
|
58 |
|
59 |
The model is also hosted on [Together Playground](https://api.together.xyz/playground). You can simply play with the model by using prompt formatted by:
|
60 |
|
61 |
```
|
62 |
+
[INST]\n<your instruction here>\n[\INST]\n\n
|
63 |
```
|
64 |
|
65 |
For example, if we query the model with
|
66 |
|
67 |
```
|
68 |
+
[INST]\nWrite a poem about cats\n[\INST]\n\n
|
69 |
```
|
70 |
|
71 |
the model will return
|
72 |
```
|
73 |
+
[INST]
|
74 |
+
Write a poem about cats
|
75 |
+
[/INST]
|
76 |
+
|
77 |
+
Cats are mysterious creatures, with their aloof and independent nature. They're also incredibly beautiful, with their sleek fur and piercing eyes. Here's a poem that captures the essence of cats:
|
78 |
+
|
79 |
+
Cats, oh cats, how can I describe you?
|
80 |
+
Your beauty is beyond compare, it seems.
|
81 |
+
You're graceful and elegant, like a ballerina's dance,
|
82 |
+
But don't let your charm fool you, for you're not easily tamed.
|
83 |
+
|
84 |
+
With your soft purring and playful meows,
|
85 |
+
You draw us in with your enchanting powers.
|
86 |
+
We love to watch you play, your tail twirling 'round,
|
87 |
+
As if you're dancing on air, with no sound.
|
88 |
+
|
89 |
+
But don't be fooled by your sweetness, my friend,
|
90 |
+
For beneath that gentle exterior, lies a fierce defender.
|
91 |
+
When danger lurks, you'll spring into action,
|
92 |
+
Protecting those you hold dear, without question.
|
93 |
+
|
94 |
+
Solet us admire you, from afar,
|
95 |
+
For in your own way, you're truly unique, a star.
|
96 |
+
And though we may never fully understand,
|
97 |
+
The depths of your soul, we'll always stand, hand in paw, as one.
|
98 |
+
|
99 |
+
This poem captures the essence of cats, highlighting their beauty, independence,and protective nature. It also celebrates the special bond between humans and cats, recognizing their unique qualities and the joy they bring to our lives.
|
100 |
```
|
101 |
|
102 |
## Model Evaluation
|