Instructions to use logicreasoning/LogiT5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use logicreasoning/LogiT5 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("logicreasoning/LogiT5") model = AutoModelForSeq2SeqLM.from_pretrained("logicreasoning/LogiT5", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -8,8 +8,8 @@ model_name = 'logicreasoning/LogiT5'
|
|
| 8 |
tokenize = AutoTokenizer.from_pretrained(model_name)
|
| 9 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
| 10 |
device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
|
| 11 |
-
input_text = '' #your input text here
|
| 12 |
-
input = tokenize(
|
| 13 |
model = model.to(device)
|
| 14 |
output = model.generate(*input, max_length=1024)
|
| 15 |
prediction = tokenize.decode(output[0],skip_special_tokens=True)
|
|
|
|
| 8 |
tokenize = AutoTokenizer.from_pretrained(model_name)
|
| 9 |
model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
| 10 |
device = 'cuda:0' if torch.cuda.is_available() else 'cpu'
|
| 11 |
+
input_text = '' #your input text here must be a string
|
| 12 |
+
input = tokenize(input_text, return_tensors='pt', padding=True).to(device)
|
| 13 |
model = model.to(device)
|
| 14 |
output = model.generate(*input, max_length=1024)
|
| 15 |
prediction = tokenize.decode(output[0],skip_special_tokens=True)
|