Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ def correct_text(input_text):
|
|
10 |
# Tokenize the input text
|
11 |
inputs = tokenizer.encode("correct: " + input_text, return_tensors="pt")
|
12 |
|
13 |
-
# Generate the corrected text
|
14 |
outputs = model.generate(inputs, max_length=128, num_beams=4, early_stopping=True)
|
15 |
|
16 |
# Decode the generated text
|
@@ -20,7 +20,7 @@ def correct_text(input_text):
|
|
20 |
# Create Gradio interface
|
21 |
iface = gr.Interface(
|
22 |
fn=correct_text,
|
23 |
-
inputs=gr.
|
24 |
outputs="text",
|
25 |
title="Grammar Correction",
|
26 |
description="Enter a sentence with grammatical errors and get the corrected sentence."
|
|
|
10 |
# Tokenize the input text
|
11 |
inputs = tokenizer.encode("correct: " + input_text, return_tensors="pt")
|
12 |
|
13 |
+
# Generate the corrected text
|
14 |
outputs = model.generate(inputs, max_length=128, num_beams=4, early_stopping=True)
|
15 |
|
16 |
# Decode the generated text
|
|
|
20 |
# Create Gradio interface
|
21 |
iface = gr.Interface(
|
22 |
fn=correct_text,
|
23 |
+
inputs=gr.Textbox(lines=2, placeholder="Enter text with grammar errors here..."),
|
24 |
outputs="text",
|
25 |
title="Grammar Correction",
|
26 |
description="Enter a sentence with grammatical errors and get the corrected sentence."
|