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()