import gradio as gr 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)." title = "Conversational Question Rewriting" examples = [["What was the next instrument he learned to play? 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. Did Jimi Hendrix teach himself to play the ukulele? 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. What was the first instrument Jimi Hendrix learned to play?"], ["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?"], ["What does it cost? Complete your bachelor's degree (a science or healthcare related major is usually best); Gain experience either working or volunteering in a healthcare setting; Apply to ARC-PA accredited physician assistant programs; Complete a 2-3 year, master's level PA program. What are the educational requirements required to become a physician's assistant? physician assistants are medical providers who are licensed to diagnose and treat illness and disease and to prescribe medication for patients. What is a physician's assistant?"], ["What did the social worker do about this? At Horace Mann Elementary School during the mid-1950s, Jimi Hendrix's habit of carrying a broom with him to emulate a guitar gained the attention of the school's social worker. Is there anything else interesting about the year 1966 for Jimi Hendrix? In mid-November 1966, the Jimi Hendrix Experience performed at the Bag O'Nails nightclub in London, with Eirc Clapton, John Lennon, Paul McCartney, Jeff Beck, and others in attendance. When did Jimi Hendrix first gain fame for his playing? Jimi Hendrix's first gig was with an unnamed band in the Jaffe Room of Seattle's Temple De Hirsch Sinai, but they fired him between sets for showing off. When did Jimi Hendrix first start playing for the public? Did Jimi Hendrix ever play any other instruments besides ukulele and guitar? In mid-1959, Jimi Hendrix's father relented and bought him a white Supro Ozark. When did Jimi Hendrix get his first electric guitar? In 1959, attending a concert by Hank Ballard & the Midnighters in Seattle, Jimi Hendrix met the group's guitarist Billy Davis. Davis showed him some guitar licks. Did Jimi Hendrix ever get any guitar lessons?"]] #examples.reverse() #flat_list = [item for sublist in examples for item in sublist] #examples = [' '.join(flat_list)] interface = gr.Interface.load("huggingface/nichal/pegasus_QR", description=description, examples=examples ) interface.launch()