nichal commited on
Commit
d836290
1 Parent(s): 5343526

add examples

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -1,13 +1,13 @@
1
  import gradio as gr
2
 
3
- description = "Question Rewriting with the PEGASUS model and using previous conversation turns \n To use this app, the input has to correspond to, first, the question to be rewritten, and then the conversation turns in a reverse chronological order (most recent turns appear first)."
4
  title = "Conversational Question Rewriting"
5
- examples = [["What was the first instrument Jimi Hendrix learned to play?"], ["In 1957, while helping his father with a side-job Jimi Hendrix found a ukulele amongst the garbage they were removing from an older woman's home."], ["Did Jimi Hendrix teach himself to play the ukulele?"], ["She told him that he could keep the ukulele, which had only one string. Learning by ear, Jimi Hendrix played single notes, following along to Elvis Presley songs."], ["What was the next instrument he learned to play?"]]
6
 
7
- examples.reverse()
8
- flat_list = [item for sublist in examples for item in sublist]
9
 
10
- examples = [' '.join(flat_list)]
11
 
12
 
13
  interface = gr.Interface.load("huggingface/nichal/pegasus_QR",
 
1
  import gradio as gr
2
 
3
+ description = "Question Rewriting with the PEGASUS model and using previous conversation turns. To use this app, the input has to correspond to, first, the question to be rewritten, and then the conversation turns in a reverse chronological order (most recent turns appear first)."
4
  title = "Conversational Question Rewriting"
5
+ examples = [["What was the first instrument Jimi Hendrix learned to play? In 1957, while helping his father with a side-job Jimi Hendrix found a ukulele amongst the garbage they were removing from an older woman's home. Did Jimi Hendrix teach himself to play the ukulele? She told him that he could keep the ukulele, which had only one string. Learning by ear, Jimi Hendrix played single notes, following along to Elvis Presley songs. What was the next instrument he learned to play?"], ["Are there any other interesting aspects about this article? The album was nominated for the 2002 Grammy Award for Best Contemporary Folk Album, but lost to Bob Dylan's Love and Theft. Did Time by Gillian Welch stay on the charts long? Time peaked at No. 7 on the Billboard Independent Album chart. Did many people like Time by Gillian Welch? All but one song on the album was recorded in the historic RCA Studio B in Nashville. What else did Gillian Welch appear in? Time (The Revelator) received extensive critical praise. How successful was Gillian Welch's label's first release? Welch has said the album is about American history, rock 'n' roll, and country music. Can you explain Time (The Revelator)?"], ["What were their record sales like? The Cardigans have an assortment of hits. Did The Cardigans have other great hits? The Cardigans' Lovefool was a hit worldwide, particularly in the US and Japan, where the album reached platinum status in three weeks. How was the success of The Cardigans' first popular song?"]]
6
 
7
+ #examples.reverse()
8
+ #flat_list = [item for sublist in examples for item in sublist]
9
 
10
+ #examples = [' '.join(flat_list)]
11
 
12
 
13
  interface = gr.Interface.load("huggingface/nichal/pegasus_QR",