umaiku commited on
Commit
a1e734a
·
verified ·
1 Parent(s): 85c33ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -42,10 +42,13 @@ def respond(
42
  print(datetime.now())
43
  print(system_message)
44
 
45
- prompt_en = client.text_generation("Improve or translate the following user's prompt to English giving only the new prompt without explanations or additional text: " + message)
46
- prompt_de = client.text_generation("Improve or translate the following user's prompt to German giving only the new prompt without explanations or additional text: " + message)
47
- prompt_fr = client.text_generation("Improve or translate the following user's prompt to French giving only the new prompt without explanations or additional text: " + message)
48
- prompt_it = client.text_generation("Improve or translate the following user's prompt to Italian giving only the new prompt without explanations or additional text: " + message)
 
 
 
49
 
50
  print(prompt_en)
51
  print(prompt_de)
 
42
  print(datetime.now())
43
  print(system_message)
44
 
45
+ prompt_template = "Improve or translate the following user's prompt to {language} giving only the new prompt\
46
+ without explanations or additional text and if you can't improve it, just return the same prompt, do not extrapolate: "
47
+
48
+ prompt_en = client.text_generation(prompt_template.format(language="English") + message)
49
+ prompt_de = client.text_generation(prompt_template.format(language="German") + message)
50
+ prompt_fr = client.text_generation(prompt_template.format(language="French") + message)
51
+ prompt_it = client.text_generation(prompt_template.format(language="Italian") + message)
52
 
53
  print(prompt_en)
54
  print(prompt_de)