Wynand du Plessis commited on
Commit
60c1642
·
1 Parent(s): 7367e75

Image to chatbot update

Browse files
Files changed (1) hide show
  1. stream_app.py +9 -8
stream_app.py CHANGED
@@ -41,7 +41,7 @@ def run_gradio(config:dict):
41
 
42
  def get_teacher_prompt(language_input, cefr_level_input, is_initial_image):
43
  global teacher_prompt
44
- teacher_prompt = f"Act as a {language_input} teacher only speaking in {language_input}. Help me learn spanish."
45
  teacher_image_prompt = f"Here is a photo to start the conversation."
46
  if is_initial_image is True:
47
  return teacher_prompt+teacher_image_prompt
@@ -288,6 +288,14 @@ def run_gradio(config:dict):
288
  with gr.Row():
289
  with gr.Column():
290
 
 
 
 
 
 
 
 
 
291
  image_input = gr.Image(
292
  label="Image Input",
293
  type="pil",
@@ -340,13 +348,6 @@ def run_gradio(config:dict):
340
 
341
  with gr.Group():
342
  with gr.Accordion("Settings", open=False):
343
- with gr.Row():
344
- language_input = gr.Dropdown(
345
- ["English","French","Mandarin","Spanish","German","Italian"], value="Spanish", label="Target Language", info="Select the language you're learning", interactive=True
346
- )
347
- cefr_level_input = gr.Dropdown(
348
- ["A0 - brand new","A1 - basic phrases","A2 - basic interactions","B1 - basic conversation","B2 - conversational"], value="A0 - brand new", label="Your CEFR Level", info="Your currently ability in the language", interactive=True
349
- )
350
  teacher_text = gr.Textbox(
351
  label="Teacher Prompt",
352
  lines=5,
 
41
 
42
  def get_teacher_prompt(language_input, cefr_level_input, is_initial_image):
43
  global teacher_prompt
44
+ teacher_prompt = f"Act as a {language_input} teacher only speaking in {language_input}. Help me learn spanish. I am currently at a {cefr_level_input} of speaking."
45
  teacher_image_prompt = f"Here is a photo to start the conversation."
46
  if is_initial_image is True:
47
  return teacher_prompt+teacher_image_prompt
 
288
  with gr.Row():
289
  with gr.Column():
290
 
291
+ with gr.Row():
292
+ language_input = gr.Dropdown(
293
+ ["English","French","Mandarin","Spanish","German","Italian"], value="Spanish", label="Target Language", info="Select the language you're learning", interactive=True
294
+ )
295
+ cefr_level_input = gr.Dropdown(
296
+ ["A0 - brand new","A1 - basic phrases","A2 - basic interactions","B1 - basic conversation","B2 - conversational"], value="A0 - brand new", label="Your CEFR Level", info="Your currently ability in the language", interactive=True
297
+ )
298
+
299
  image_input = gr.Image(
300
  label="Image Input",
301
  type="pil",
 
348
 
349
  with gr.Group():
350
  with gr.Accordion("Settings", open=False):
 
 
 
 
 
 
 
351
  teacher_text = gr.Textbox(
352
  label="Teacher Prompt",
353
  lines=5,