Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -70,15 +70,14 @@ def translation(source, target, text):
|
|
70 |
try:
|
71 |
input_prompt = bloom_template.replace("{source}", source)
|
72 |
input_prompt = input_prompt.replace("{target}", target)
|
73 |
-
input_prompt = input_prompt.replace("{query}", chunk)
|
74 |
stchunk = llm3(input_prompt)
|
75 |
for eot in bloom_model_kwargs['stop']:
|
76 |
-
stchunk = stchunk.replace(eot,"\n"
|
77 |
response += stchunk
|
78 |
except Exception as e:
|
79 |
print(f"ERROR: LLM show {e}")
|
80 |
-
response = response.strip()
|
81 |
if response == "": response = text
|
82 |
-
return response
|
83 |
|
84 |
gr.Interface(translation, inputs=["text","text","text"], outputs="text").launch()
|
|
|
70 |
try:
|
71 |
input_prompt = bloom_template.replace("{source}", source)
|
72 |
input_prompt = input_prompt.replace("{target}", target)
|
73 |
+
input_prompt = input_prompt.replace("{query}", chunk.strip())
|
74 |
stchunk = llm3(input_prompt)
|
75 |
for eot in bloom_model_kwargs['stop']:
|
76 |
+
stchunk = stchunk.replace(eot,"")+"\n"
|
77 |
response += stchunk
|
78 |
except Exception as e:
|
79 |
print(f"ERROR: LLM show {e}")
|
|
|
80 |
if response == "": response = text
|
81 |
+
return response.strip()
|
82 |
|
83 |
gr.Interface(translation, inputs=["text","text","text"], outputs="text").launch()
|