Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -48,14 +48,23 @@ Trained on the [lucasmccabe/logiqa](https://huggingface.co/datasets/lucasmccabe/
|
|
| 48 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 49 |
import torch
|
| 50 |
|
| 51 |
-
model = AutoModelForCausalLM.from_pretrained(
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
outputs = model.generate(**inputs, max_new_tokens=150)
|
| 58 |
-
print(tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 59 |
|
| 60 |
```
|
| 61 |
|
|
|
|
| 48 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 49 |
import torch
|
| 50 |
|
| 51 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 52 |
+
"rudranshjoshi/circuit",
|
| 53 |
+
torch_dtype=torch.float16,
|
| 54 |
+
trust_remote_code=True
|
| 55 |
+
)
|
| 56 |
+
tokenizer = AutoTokenizer.from_pretrained(
|
| 57 |
+
"rudranshjoshi/circuit",
|
| 58 |
+
trust_remote_code=True
|
| 59 |
+
)
|
| 60 |
+
|
| 61 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 62 |
+
model.to(device)
|
| 63 |
+
|
| 64 |
+
prompt = "Your prompt here"
|
| 65 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(device)
|
| 66 |
outputs = model.generate(**inputs, max_new_tokens=150)
|
| 67 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 68 |
|
| 69 |
```
|
| 70 |
|