mbarnig commited on
Commit
89a922c
·
verified ·
1 Parent(s): 80c8ef8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
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 "Schreif eng Fro als Input"
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 "To serach you need to enter an RTL password !"
97
  elif password != mypassword:
98
- yield "Please enter the correct RTL password !"
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 : What happened in the country 🇱🇺 or in the world 🌎 ?</h2>")
119
  with gr.Row():
120
  myDescription = gr.HTML("""
121
- <h3 align='center'>Wat fir een Thema interesséiert Iech ?</h3>
122
  <p align='center'>🐶 🏃🏻‍♂️ 🌗 🍇 🌈 🍽️ 🏆 🚘 ✈️ 🩺 </p>
123
- <p align='center' bgcolor="Moccasin">Submit your question in english or in another language !</p>
124
  """
125
  )
126
  with gr.Row():
127
- mode = gr.Radio(choices=["Search", "Examples"], label = "You can run the examples without password.", value = "Examples")
128
- pw = gr.Textbox(lines=1, label="Enter the correct RTL password !")
129
  with gr.Row():
130
- question = gr.Textbox(lines=3, label="Please submit your 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'>English RTL News :</p>")
138
  with gr.Row():
139
- myOutput = gr.Markdown(label="Answer from the OpenAI File-Search Assistent :")
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()