nichal commited on
Commit
224d2a1
1 Parent(s): 96a5fc8
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -1,10 +1,16 @@
1
  import gradio as gr
2
 
3
- description = "Story generation with GPT-2"
4
- title = "Generate your own story"
5
- examples = [["Adventurer is approached by a mysterious stranger in the tavern for a new quest."]]
6
 
7
- interface = gr.Interface.load("huggingface/pranavpsv/gpt2-genre-story-generator",
 
 
 
 
 
 
8
  description=description,
9
  examples=examples
10
  )
 
1
  import gradio as gr
2
 
3
+ description = "Question Rewriting with the PEGASUS model and using previous conversation turns"
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_input = [item for sublist in l for item in sublist]
9
+
10
+ examples = [' '.join(flat_list)]
11
+
12
+
13
+ interface = gr.Interface.load("huggingface/nichal/pegasus_QR",
14
  description=description,
15
  examples=examples
16
  )