Spaces:
Build error
Build error
update
Browse files
app.py
CHANGED
@@ -106,17 +106,27 @@ def whisper_stt(audio):
|
|
106 |
# LLM - Bloom Response
|
107 |
def lang_model_response(prompt, language):
|
108 |
print(f"Inside lang_model_response - Prompt is :{prompt}")
|
109 |
-
|
110 |
Answer: I am doing good, thanks.
|
111 |
Question: """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
if len(prompt) == 0:
|
113 |
prompt = """Question: Can you help me please?
|
114 |
Answer: Sure, I am here for you.
|
115 |
Question: """
|
116 |
|
117 |
if language == 'en':
|
118 |
-
prompt =
|
119 |
-
|
|
|
|
|
|
|
120 |
|
121 |
json_ = {"inputs": prompt,
|
122 |
"parameters":
|
|
|
106 |
# LLM - Bloom Response
|
107 |
def lang_model_response(prompt, language):
|
108 |
print(f"Inside lang_model_response - Prompt is :{prompt}")
|
109 |
+
p_en = """Question: How are you doing today?
|
110 |
Answer: I am doing good, thanks.
|
111 |
Question: """
|
112 |
+
p_es = """Pregunta: Cómo estás hoy?
|
113 |
+
Responder: Estoy bien, gracias.
|
114 |
+
Pregunta: """
|
115 |
+
p_fr = """Question: Comment vas-tu aujourd'hui?
|
116 |
+
Réponse: Je vais bien, merci.
|
117 |
+
Question: """
|
118 |
+
|
119 |
if len(prompt) == 0:
|
120 |
prompt = """Question: Can you help me please?
|
121 |
Answer: Sure, I am here for you.
|
122 |
Question: """
|
123 |
|
124 |
if language == 'en':
|
125 |
+
prompt = p_en + prompt + "\n" + "Answer: "
|
126 |
+
elif language == 'es':
|
127 |
+
prompt = p_es + prompt + "\n" + "Responder: "
|
128 |
+
elif language == 'fr':
|
129 |
+
prompt = p_fr + prompt + "\n" + "Réponse: "
|
130 |
|
131 |
json_ = {"inputs": prompt,
|
132 |
"parameters":
|