nikhedward commited on
Commit
0960b2a
1 Parent(s): ede862c

added examples

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -30,6 +30,19 @@ res = nlp(QA_input)
30
  model = AutoModelForQuestionAnswering.from_pretrained(model_name)
31
  tokenizer = AutoTokenizer.from_pretrained(model_name)
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  import gradio as gr
35
  #context = "The Amazon rainforest, also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species."
@@ -47,5 +60,6 @@ demo = gr.Interface.load(
47
  #,gr.outputs.Textbox(label="Score")
48
  ],
49
  description=desc,
50
- title=title)
 
51
  demo.launch()
 
30
  model = AutoModelForQuestionAnswering.from_pretrained(model_name)
31
  tokenizer = AutoTokenizer.from_pretrained(model_name)
32
 
33
+ text_1 = """
34
+ Miss Brill' is the story of an old woman told brilliantly and realistically, balancing thoughts and emotions that sustain her late solitary life amidst all the bustle of modern life. Miss Brill is a regular visitor on Sundays to the Jardins Publiques (the Public Gardens) of a small French suburb where she sits and watches all sorts of people come and go.
35
+ """
36
+
37
+ text_2 = """
38
+ Senior British royals, including Prince William and his wife, Duchess Kate, went to church on Easter Sunday without the queen. Queen Elizabeth II, who has been experiencing mobility problems, did not attend the service at St. George's Chapel on the grounds of Windsor Castle, a fixture in the royals' calendar. William and Kate, known as the Duke and Duchess of Cambridge,
39
+ """
40
+ text_3 = """
41
+ In the article “Bats,” by Debbie Dean, we learn that in contrast to some mistaken beliefs, bats have sight, are mammals, and are not especially likely to carry rabies. Bats are relatively misunderstood and unappreciated. Bats have some interesting physical features. They have similar bone structure and skeletons to that of humans, so they are not winged rodents.
42
+ """
43
+ sample_texts = [[text_1], [text_2], [text_3]]
44
+
45
+
46
 
47
  import gradio as gr
48
  #context = "The Amazon rainforest, also known in English as Amazonia or the Amazon Jungle, is a moist broadleaf forest that covers most of the Amazon basin of South America. This basin encompasses 7,000,000 square kilometres (2,700,000 sq mi), of which 5,500,000 square kilometres (2,100,000 sq mi) are covered by the rainforest. This region includes territory belonging to nine nations. The majority of the forest is contained within Brazil, with 60% of the rainforest, followed by Peru with 13%, Colombia with 10%, and with minor amounts in Venezuela, Ecuador, Bolivia, Guyana, Suriname and French Guiana. The Amazon represents over half of the planet's remaining rainforests, and comprises the largest and most biodiverse tract of tropical rainforest in the world, with an estimated 390 billion individual trees divided into 16,000 species."
 
60
  #,gr.outputs.Textbox(label="Score")
61
  ],
62
  description=desc,
63
+ title=title,
64
+ examples = sample_texts)
65
  demo.launch()