not-lain commited on
Commit
5225bb2
1 Parent(s): 288f693

switched to accordio layout

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -407,10 +407,11 @@ languages = [
407
 
408
  with gr.Blocks(theme='ParityError/Anime') as iface :
409
  gr.Markdown(welcome_message)
410
- with gr.Tab("text summarization"):
411
  text_input = gr.Textbox(label="input text",lines=5)
412
  text_output = gr.Markdown(label="output text")
413
  text_button = gr.Button("process text")
 
414
  gr.Examples([
415
  ["What is the proper treatment for buccal herpes?"],
416
  ["Male, 40 presenting with swollen glands and a rash"],
@@ -421,27 +422,26 @@ with gr.Blocks(theme='ParityError/Anime') as iface :
421
  ["구강 헤르페스의 적절한 치료법은 무엇입니까?"],
422
  ["Je, ni matibabu gani sahihi kwa herpes ya buccal?"],
423
  ],inputs=[text_input])
424
- with gr.Tab("image identification"):
425
  image_input = gr.Image(label="upload image")
426
  image_output = gr.Markdown(label="output text")
427
  image_button = gr.Button("process image")
428
  image_button.click(process_image, inputs=image_input, outputs=image_output)
429
  gr.Examples(["sick person.jpeg"],inputs=[image_input])
430
- with gr.Tab("speech to text"):
431
  input_language = gr.Dropdown(languages, label="select the language",value="English",interactive=True)
432
  audio_input = gr.Audio(label="speak",type="filepath",sources="microphone")
433
  audio_output = gr.Markdown(label="output text")
434
  audio_button = gr.Button("process audio")
435
  audio_button.click(process_speech, inputs=[input_language,audio_input], outputs=audio_output)
436
  gr.Examples([["English","sample_input.mp3"]],inputs=[input_language,audio_input])
437
- with gr.Tab("hallucination check"):
438
  assertion = gr.Textbox(label="assertion")
439
  citation = gr.Textbox(label="citation text")
440
  hullucination_output = gr.Markdown(label="output text")
441
- audio_button = gr.Button("check hallucination")
442
  gr.Examples([["i am drunk","sarah is pregnant"]],inputs=[assertion,citation])
443
- text_button.click(process_and_query, inputs=text_input, outputs=text_output)
444
- audio_button.click(check_hallucination,inputs=[assertion,citation],outputs=hullucination_output)
445
 
446
 
447
 
 
407
 
408
  with gr.Blocks(theme='ParityError/Anime') as iface :
409
  gr.Markdown(welcome_message)
410
+ with gr.Accordion("text summarization",open=True):
411
  text_input = gr.Textbox(label="input text",lines=5)
412
  text_output = gr.Markdown(label="output text")
413
  text_button = gr.Button("process text")
414
+ text_button.click(process_and_query, inputs=text_input, outputs=text_output)
415
  gr.Examples([
416
  ["What is the proper treatment for buccal herpes?"],
417
  ["Male, 40 presenting with swollen glands and a rash"],
 
422
  ["구강 헤르페스의 적절한 치료법은 무엇입니까?"],
423
  ["Je, ni matibabu gani sahihi kwa herpes ya buccal?"],
424
  ],inputs=[text_input])
425
+ with gr.Accordion("image identification",open=True):
426
  image_input = gr.Image(label="upload image")
427
  image_output = gr.Markdown(label="output text")
428
  image_button = gr.Button("process image")
429
  image_button.click(process_image, inputs=image_input, outputs=image_output)
430
  gr.Examples(["sick person.jpeg"],inputs=[image_input])
431
+ with gr.Accordion("speech to text",open=True):
432
  input_language = gr.Dropdown(languages, label="select the language",value="English",interactive=True)
433
  audio_input = gr.Audio(label="speak",type="filepath",sources="microphone")
434
  audio_output = gr.Markdown(label="output text")
435
  audio_button = gr.Button("process audio")
436
  audio_button.click(process_speech, inputs=[input_language,audio_input], outputs=audio_output)
437
  gr.Examples([["English","sample_input.mp3"]],inputs=[input_language,audio_input])
438
+ with gr.Accordion("hallucination check",open=True):
439
  assertion = gr.Textbox(label="assertion")
440
  citation = gr.Textbox(label="citation text")
441
  hullucination_output = gr.Markdown(label="output text")
442
+ hallucination_button = gr.Button("check hallucination")
443
  gr.Examples([["i am drunk","sarah is pregnant"]],inputs=[assertion,citation])
444
+ hallucination_button.click(check_hallucination,inputs=[assertion,citation],outputs=hullucination_output)
 
445
 
446
 
447