Spaces:
Sleeping
Sleeping
Yehor Smoliakov
commited on
Commit
·
75af226
1
Parent(s):
b2fe391
Fixes
Browse files
app.py
CHANGED
|
@@ -87,9 +87,9 @@ def inference(text, progress=gr.Progress()):
|
|
| 87 |
if not text:
|
| 88 |
raise gr.Error("Please paste your text.")
|
| 89 |
|
| 90 |
-
gr.Info("Starting
|
| 91 |
|
| 92 |
-
progress(0, desc="
|
| 93 |
|
| 94 |
results = []
|
| 95 |
|
|
@@ -97,7 +97,7 @@ def inference(text, progress=gr.Progress()):
|
|
| 97 |
text,
|
| 98 |
]
|
| 99 |
|
| 100 |
-
for sentence in progress.tqdm(sentences, desc="
|
| 101 |
sentence = sentence.strip()
|
| 102 |
|
| 103 |
if len(sentence) == 0:
|
|
@@ -105,7 +105,7 @@ def inference(text, progress=gr.Progress()):
|
|
| 105 |
|
| 106 |
t0 = time.time()
|
| 107 |
|
| 108 |
-
input_text =
|
| 109 |
|
| 110 |
encoded_input = tokenizer(
|
| 111 |
input_text,
|
|
@@ -162,12 +162,12 @@ with demo:
|
|
| 162 |
with gr.Row():
|
| 163 |
text = gr.Textbox(label="Text", autofocus=True, max_lines=1)
|
| 164 |
normalized_text = gr.Textbox(
|
| 165 |
-
label="
|
| 166 |
placeholder=normalized_text_value,
|
| 167 |
show_copy_button=True,
|
| 168 |
)
|
| 169 |
|
| 170 |
-
gr.Button("
|
| 171 |
inference,
|
| 172 |
concurrency_limit=concurrency_limit,
|
| 173 |
inputs=text,
|
|
|
|
| 87 |
if not text:
|
| 88 |
raise gr.Error("Please paste your text.")
|
| 89 |
|
| 90 |
+
gr.Info("Starting", duration=2)
|
| 91 |
|
| 92 |
+
progress(0, desc="Correcting...")
|
| 93 |
|
| 94 |
results = []
|
| 95 |
|
|
|
|
| 97 |
text,
|
| 98 |
]
|
| 99 |
|
| 100 |
+
for sentence in progress.tqdm(sentences, desc="Correcting...", unit="sentence"):
|
| 101 |
sentence = sentence.strip()
|
| 102 |
|
| 103 |
if len(sentence) == 0:
|
|
|
|
| 105 |
|
| 106 |
t0 = time.time()
|
| 107 |
|
| 108 |
+
input_text = sentence
|
| 109 |
|
| 110 |
encoded_input = tokenizer(
|
| 111 |
input_text,
|
|
|
|
| 162 |
with gr.Row():
|
| 163 |
text = gr.Textbox(label="Text", autofocus=True, max_lines=1)
|
| 164 |
normalized_text = gr.Textbox(
|
| 165 |
+
label="Corrected text",
|
| 166 |
placeholder=normalized_text_value,
|
| 167 |
show_copy_button=True,
|
| 168 |
)
|
| 169 |
|
| 170 |
+
gr.Button("Correct").click(
|
| 171 |
inference,
|
| 172 |
concurrency_limit=concurrency_limit,
|
| 173 |
inputs=text,
|