asd
Browse files
app.py
CHANGED
@@ -224,6 +224,7 @@ def classify_text(text):
|
|
224 |
main_score = probabilities[0][predicted_class].item()
|
225 |
return main_label, main_score
|
226 |
|
|
|
227 |
def correct_grammar(text):
|
228 |
inputs = grammar_tokenizer(f'Fix grammatical errors in this sentence: {text}', return_tensors="pt").input_ids.to(device)
|
229 |
outputs = grammar_model.generate(inputs, max_length=256)
|
|
|
224 |
main_score = probabilities[0][predicted_class].item()
|
225 |
return main_label, main_score
|
226 |
|
227 |
+
@spaces.GPU
|
228 |
def correct_grammar(text):
|
229 |
inputs = grammar_tokenizer(f'Fix grammatical errors in this sentence: {text}', return_tensors="pt").input_ids.to(device)
|
230 |
outputs = grammar_model.generate(inputs, max_length=256)
|