File size: 935 Bytes
96a5fc8
 
224d2a1
 
 
96a5fc8
224d2a1
 
 
 
 
 
 
96a5fc8
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr

description = "Question Rewriting with the PEGASUS model and using previous conversation turns"
title = "Conversational Question Rewriting"
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?"]]

examples.reverse()
flat_input = [item for sublist in l for item in sublist]

examples = [' '.join(flat_list)]   


interface = gr.Interface.load("huggingface/nichal/pegasus_QR",
            description=description,
            examples=examples
)

interface.launch()