NoaiGPT commited on
Commit
49f2af8
1 Parent(s): 6ef36dc
Files changed (1) hide show
  1. app.py +1 -0
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)