TiberiuCristianLeon commited on
Commit
059e62b
·
verified ·
1 Parent(s): 300f601

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -67,11 +67,11 @@ if submit_button:
67
  messages = [
68
  {"role": "user", "content": f"Translate the following text from {sselected_language} into {tselected_language}.\n{sselected_language}: {input_text}.\n{tselected_language}:"},
69
  ]
70
- prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
71
  outputs = pipe(prompt, max_new_tokens=256, do_sample=False)
72
  translated_text = outputs[0]["generated_text"]
73
 
74
  # Display the translated text
75
  print(translated_text)
76
- st.write(f"Translated text from {sselected_language} to {tselected_language} using {model_name}")
77
  translated_textarea = st.text(translated_text)
 
67
  messages = [
68
  {"role": "user", "content": f"Translate the following text from {sselected_language} into {tselected_language}.\n{sselected_language}: {input_text}.\n{tselected_language}:"},
69
  ]
70
+ prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=False)
71
  outputs = pipe(prompt, max_new_tokens=256, do_sample=False)
72
  translated_text = outputs[0]["generated_text"]
73
 
74
  # Display the translated text
75
  print(translated_text)
76
+ st.write(f"Translated text from {sselected_language} to {tselected_language} using {model_name}:")
77
  translated_textarea = st.text(translated_text)