Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,7 @@ def translation(source, target, text):
|
|
54 |
for stop_str in bloom_model_kwargs['stop_sequences']:
|
55 |
if output.endswith(stop_str):
|
56 |
output = output[:-len(stop_str)]
|
57 |
-
yield output.replace("<newline>","\n")
|
58 |
#yield output.replace("<newline>","\n")
|
59 |
result += output
|
60 |
except Exception as e:
|
@@ -62,6 +62,6 @@ def translation(source, target, text):
|
|
62 |
time.sleep(1)
|
63 |
#yield result.replace("<newline>","\n").strip()
|
64 |
if result == "": result = text
|
65 |
-
return result.replace("<newline>","\n").strip()
|
66 |
|
67 |
gr.Interface(translation, inputs=["text","text","text"], outputs="text").queue(concurrency_count=100).launch()
|
|
|
54 |
for stop_str in bloom_model_kwargs['stop_sequences']:
|
55 |
if output.endswith(stop_str):
|
56 |
output = output[:-len(stop_str)]
|
57 |
+
yield output.replace("<newline>","\n").replace("</newline>","\n")
|
58 |
#yield output.replace("<newline>","\n")
|
59 |
result += output
|
60 |
except Exception as e:
|
|
|
62 |
time.sleep(1)
|
63 |
#yield result.replace("<newline>","\n").strip()
|
64 |
if result == "": result = text
|
65 |
+
return result.replace("<newline>","\n").replace("</newline>","\n").strip()
|
66 |
|
67 |
gr.Interface(translation, inputs=["text","text","text"], outputs="text").queue(concurrency_count=100).launch()
|