Spaces:
Runtime error
Runtime error
dentadelta123
commited on
Commit
·
6fc35f2
1
Parent(s):
1267113
update requirements.txt
Browse files- app.py +2 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -16,7 +16,7 @@ def generate_text(text):
|
|
16 |
).input_ids
|
17 |
input_ids = input_ids.to(device)
|
18 |
|
19 |
-
outputs = model.generate(input_ids)
|
20 |
|
21 |
return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
22 |
|
@@ -24,7 +24,7 @@ def generate_text(text):
|
|
24 |
with gr.Blocks() as deeplearning:
|
25 |
with gr.Row():
|
26 |
with gr.Column():
|
27 |
-
text = gr.
|
28 |
button = gr.Button(label="Correct")
|
29 |
output = gr.outputs.Textbox(label="Corrected Text")
|
30 |
|
|
|
16 |
).input_ids
|
17 |
input_ids = input_ids.to(device)
|
18 |
|
19 |
+
outputs = model.generate(input_ids, max_length=512, early_stopping=True)
|
20 |
|
21 |
return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
22 |
|
|
|
24 |
with gr.Blocks() as deeplearning:
|
25 |
with gr.Row():
|
26 |
with gr.Column():
|
27 |
+
text = gr.TextArea(placeholder="Enter your text here...")
|
28 |
button = gr.Button(label="Correct")
|
29 |
output = gr.outputs.Textbox(label="Corrected Text")
|
30 |
|
requirements.txt
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
transformers
|
2 |
torch
|
3 |
-
|
|
|
1 |
transformers
|
2 |
torch
|
3 |
+
sentencepiece
|