Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,7 @@ from transformers import T5ForConditionalGeneration, T5Tokenizer
|
|
11 |
import torch
|
12 |
torch_device = 'cuda' if torch.cude.is_available() else 'cpu'
|
13 |
tokenizer = T5Tokenizer.from_pretrained('deep-learning-analytics/GrammarCorrector')
|
14 |
-
model =
|
15 |
|
16 |
def correct_grammar(input_text, num_correct_options=num_correct_options):
|
17 |
batch = tokenizer([input_text], truncation=True, padding = 'max length', max_length = 64, return_tensors = 'pt').to(torch_device)
|
|
|
11 |
import torch
|
12 |
torch_device = 'cuda' if torch.cude.is_available() else 'cpu'
|
13 |
tokenizer = T5Tokenizer.from_pretrained('deep-learning-analytics/GrammarCorrector')
|
14 |
+
model = T5ForConditionalGeneration.from_pretrained('deep-learning-analytics/GrammarCorrector').to(torch_device)
|
15 |
|
16 |
def correct_grammar(input_text, num_correct_options=num_correct_options):
|
17 |
batch = tokenizer([input_text], truncation=True, padding = 'max length', max_length = 64, return_tensors = 'pt').to(torch_device)
|