Update README.md
Browse files
README.md
CHANGED
|
@@ -1,13 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
| 4 |
-
|
| 5 |
-
model_name = 'logicreasoning/LogiT5'
|
| 6 |
-
tokenize = AutoTokenizer.from_pretrained(model_name)
|
| 7 |
-
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
| 8 |
-
device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
|
| 9 |
-
input_text = '' #your input text here
|
| 10 |
-
input = tokenize(input, return_tensors='pt', padding=True).to(device)
|
| 11 |
-
model = model.to(device)
|
| 12 |
-
output = model.generate(*input, max_length=1024)
|
| 13 |
-
prediction = tokenize.decode(output[0],skip_special_tokens=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|