zhangce commited on
Commit
294d968
1 Parent(s): 6fd5a28

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +34 -26
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", trust_remote_code=True, torch_dtype=torch.float16)
52
- input_ids = tokenizer.encode(<your instruction>, return_tensors="pt")
53
- output = model.generate(input_ids, max_length=128, temperature=0.7)
 
 
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] <your instruction here> [\INST]\n\n
61
  ```
62
 
63
  For example, if we query the model with
64
 
65
  ```
66
- [INST] Write a poem about cats [\INST]\n\n
67
  ```
68
 
69
  the model will return
70
  ```
71
- Sure, here's a short poem about cats:
72
-
73
- Cats, cats, oh how they enthrall,
74
- With their soft fur and gentle grace,
75
- They purr with joy, their eyes aglow,
76
- And steal our hearts with their charm and grace.
77
-
78
- In their own time, they move about,
79
- With graceful strides, they tiptoe out,
80
- Their whiskers twitching, as they go,
81
- Their curiosity piqued, they want to know.
82
-
83
- They climb, they jump, they play, they chase,
84
- Their agility, a sight to behold,
85
- Their naps, a treat, a break from the chase,
86
- A time to rest, a time to be told.
87
-
88
- Cats, cats, they're unique and special,
89
- A part of our lives, a treasure to hold,
90
- Their personalities, so diverse,
91
- Their charm, a gift, that's forever told.
 
 
 
 
 
 
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