huu-ontocord
commited on
Commit
•
a3afe7b
1
Parent(s):
8b6d947
Update README.md
Browse files
README.md
CHANGED
@@ -47,4 +47,14 @@ Imagine a vast kingdom, stretching far beyond the horizon, where countless villa
|
|
47 |
|
48 |
Now, imagine that instead of messengers, horses, or ships, there exists a magical network of invisible threads connecting all these villages. This network is invisible to the eye, yet it allows messages, scroll
|
49 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
See the [Phi-3-medium-128k-instruct](https://huggingface.co/microsoft/Phi-3-medium-128k-instruct) model card for more details.
|
|
|
47 |
|
48 |
Now, imagine that instead of messengers, horses, or ships, there exists a magical network of invisible threads connecting all these villages. This network is invisible to the eye, yet it allows messages, scroll
|
49 |
```
|
50 |
+
|
51 |
+
```
|
52 |
+
import torch
|
53 |
+
with torch.no_grad():
|
54 |
+
print(tokenizer.batch_decode(model.generate(**tokenizer("<|user|>\nExplain why it is surprising that one can build a language model small enough to fit on a phone, yet almost as powerful as ChatGPT. Just use one funny sentence.<|end|>\n<|assistant|>\n", return_tensors="pt").to('cuda'), max_new_tokens=128), use_cache=True)[0])
|
55 |
+
```
|
56 |
+
Will produce:
|
57 |
+
```
|
58 |
+
<|user|> Explain why it is surprising that one can build a language model small enough to fit on a phone, yet almost as powerful as ChatGPT. Just use one funny sentence.<|end|><|assistant|> "Who knew that fitting a ChatGPT rival in your pocket would be easier than fitting a penguin in a pocket-sized suit!"<|end|>
|
59 |
+
```
|
60 |
See the [Phi-3-medium-128k-instruct](https://huggingface.co/microsoft/Phi-3-medium-128k-instruct) model card for more details.
|