futranbg commited on
Commit
6471f80
·
1 Parent(s): 0d08116

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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()