Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -57,7 +57,7 @@ async def initialize_thread():
|
|
57 |
|
58 |
async def generate_response(user_input):
|
59 |
if user_input == "":
|
60 |
-
yield "
|
61 |
else:
|
62 |
assistant_id = session_data["assistant_id"]
|
63 |
thread_id = session_data["thread_id"]
|
@@ -93,9 +93,9 @@ async def gradio_chat_interface(mode, password, user_input, example):
|
|
93 |
else:
|
94 |
# check the password
|
95 |
if password == "":
|
96 |
-
yield "
|
97 |
elif password != mypassword:
|
98 |
-
yield "
|
99 |
else:
|
100 |
|
101 |
# Create a new event loop if none exists (or if we are in a new thread)
|
@@ -115,28 +115,28 @@ async def gradio_chat_interface(mode, password, user_input, example):
|
|
115 |
|
116 |
with gr.Blocks() as demo:
|
117 |
with gr.Row():
|
118 |
-
myTitle = gr.HTML("<h2 align=center>RTL AI News Reader :
|
119 |
with gr.Row():
|
120 |
myDescription = gr.HTML("""
|
121 |
-
<h3 align='center'>
|
122 |
<p align='center'>🐶 🏃🏻♂️ 🌗 🍇 🌈 🍽️ 🏆 🚘 ✈️ 🩺 </p>
|
123 |
-
<p align='center' bgcolor="Moccasin">
|
124 |
"""
|
125 |
)
|
126 |
with gr.Row():
|
127 |
-
mode = gr.Radio(choices=["
|
128 |
-
pw = gr.Textbox(lines=1, label="
|
129 |
with gr.Row():
|
130 |
-
question = gr.Textbox(lines=3, label="
|
131 |
with gr.Row():
|
132 |
examples = gr.Radio(["What happened in May 2009 ?"], value="What happened in May 2009 ?", label="Beispiller")
|
133 |
with gr.Row():
|
134 |
clear = gr.Button("Clear")
|
135 |
submit = gr.Button("Submit")
|
136 |
with gr.Row():
|
137 |
-
mySubtitle = gr.HTML("<p align='center' bgcolor='Khaki'>
|
138 |
with gr.Row():
|
139 |
-
myOutput = gr.Markdown(label="
|
140 |
|
141 |
submit.click(fn = gradio_chat_interface, inputs=[mode, pw, question, examples], outputs = myOutput)
|
142 |
demo.launch()
|
|
|
57 |
|
58 |
async def generate_response(user_input):
|
59 |
if user_input == "":
|
60 |
+
yield "Veuillez soumettre une question !"
|
61 |
else:
|
62 |
assistant_id = session_data["assistant_id"]
|
63 |
thread_id = session_data["thread_id"]
|
|
|
93 |
else:
|
94 |
# check the password
|
95 |
if password == "":
|
96 |
+
yield "Pour faire des recherches vous devez entrer un mot de passe !"
|
97 |
elif password != mypassword:
|
98 |
+
yield "Veuillez entrer le mot de passe correct !"
|
99 |
else:
|
100 |
|
101 |
# Create a new event loop if none exists (or if we are in a new thread)
|
|
|
115 |
|
116 |
with gr.Blocks() as demo:
|
117 |
with gr.Row():
|
118 |
+
myTitle = gr.HTML("<h2 align=center>RTL AI News Reader : Quels événements ont eu lieu dans le Grand-Duché 🇱🇺 ou dans le monde 🌎 ?</h2>")
|
119 |
with gr.Row():
|
120 |
myDescription = gr.HTML("""
|
121 |
+
<h3 align='center'>Quel sujet vous intéresse ?</h3>
|
122 |
<p align='center'>🐶 🏃🏻♂️ 🌗 🍇 🌈 🍽️ 🏆 🚘 ✈️ 🩺 </p>
|
123 |
+
<p align='center' bgcolor="Moccasin">Veillez soumettre votre quetion en français ou dans une autre langue !</p>
|
124 |
"""
|
125 |
)
|
126 |
with gr.Row():
|
127 |
+
mode = gr.Radio(choices=["Recherche", "Exemples"], label = "Vous pouvez lire les exemples sans mots de passe!", value = "Exemples")
|
128 |
+
pw = gr.Textbox(lines=1, label="Veuillez entrer le mot de passe correct !")
|
129 |
with gr.Row():
|
130 |
+
question = gr.Textbox(lines=3, label="Veuillez soumettre votre question !")
|
131 |
with gr.Row():
|
132 |
examples = gr.Radio(["What happened in May 2009 ?"], value="What happened in May 2009 ?", label="Beispiller")
|
133 |
with gr.Row():
|
134 |
clear = gr.Button("Clear")
|
135 |
submit = gr.Button("Submit")
|
136 |
with gr.Row():
|
137 |
+
mySubtitle = gr.HTML("<p align='center' bgcolor='Khaki'>French RTL News :</p>")
|
138 |
with gr.Row():
|
139 |
+
myOutput = gr.Markdown(label="Réponses de l'assistant OpenAI File-Search :")
|
140 |
|
141 |
submit.click(fn = gradio_chat_interface, inputs=[mode, pw, question, examples], outputs = myOutput)
|
142 |
demo.launch()
|