Update README.md
Browse files
README.md
CHANGED
|
@@ -85,9 +85,12 @@ This project demonstrates how a compact GPT model can be designed, trained, and
|
|
| 85 |
```python
|
| 86 |
from transformers import GPT2LMHeadModel, GPT2TokenizerFast
|
| 87 |
import torch
|
|
|
|
| 88 |
|
| 89 |
-
|
| 90 |
-
|
|
|
|
|
|
|
| 91 |
|
| 92 |
def ask(prompt):
|
| 93 |
formatted = f"<|bos|>Instruction: {prompt}\nResponse:"
|
|
|
|
| 85 |
```python
|
| 86 |
from transformers import GPT2LMHeadModel, GPT2TokenizerFast
|
| 87 |
import torch
|
| 88 |
+
import os
|
| 89 |
|
| 90 |
+
os.environ["HUGGINGFACE_HUB_TOKEN"] = "Your Tokens"
|
| 91 |
+
|
| 92 |
+
model = GPT2LMHeadModel.from_pretrained("Amogh1221/PocketGPT_27M")
|
| 93 |
+
tokenizer = GPT2TokenizerFast.from_pretrained("Amogh1221/PocketGPT_27M")
|
| 94 |
|
| 95 |
def ask(prompt):
|
| 96 |
formatted = f"<|bos|>Instruction: {prompt}\nResponse:"
|