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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -17
app.py CHANGED
@@ -30,23 +30,8 @@ res = nlp(QA_input)
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."
49
- #question = "Which continent is the Amazon rainforest in?"
50
 
51
  context = """
52
  STATUS GONZALEZ CASE IS AS REPORTED REF A. AT PRESENT TIME US DISTRICT ATTORNEY WISHES TO PROSECUTE GONZALEZ IN THE US. SOME QUESTION REMAINS WHETHER HE CAN BE BOUND OVER FOR TRIAL BUT SHOULD BE DECIDED AT PRELIMINARY HEARING THIS WEEK. LOCAL AUTHORITIES AWARE OF INTEREST OF GOES AND EMBASSY AND WILL MAKE EVERY EFFORT TO NOTIFY DEPARTMENT IN ADVANCE OF RELEASE OF GONZALEZ, IF SUCH OCCURS. DEPARTMENT WOULD APPRECIATE GONZALEZ' PASSPORT NUMBER IF EMBASSY CAN OBTAIN IT. WOULD ALSO APPRECIATE EMBASSY COMMENT ON REASON FOR INTENSE GOES INTEREST IN GONZALEZ.
@@ -60,6 +45,6 @@ demo = gr.Interface.load(
60
  #,gr.outputs.Textbox(label="Score")
61
  ],
62
  description=desc,
63
- title=title,
64
- examples = sample_texts)
65
  demo.launch()
 
30
  model = AutoModelForQuestionAnswering.from_pretrained(model_name)
31
  tokenizer = AutoTokenizer.from_pretrained(model_name)
32
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
 
34
  import gradio as gr
 
 
35
 
36
  context = """
37
  STATUS GONZALEZ CASE IS AS REPORTED REF A. AT PRESENT TIME US DISTRICT ATTORNEY WISHES TO PROSECUTE GONZALEZ IN THE US. SOME QUESTION REMAINS WHETHER HE CAN BE BOUND OVER FOR TRIAL BUT SHOULD BE DECIDED AT PRELIMINARY HEARING THIS WEEK. LOCAL AUTHORITIES AWARE OF INTEREST OF GOES AND EMBASSY AND WILL MAKE EVERY EFFORT TO NOTIFY DEPARTMENT IN ADVANCE OF RELEASE OF GONZALEZ, IF SUCH OCCURS. DEPARTMENT WOULD APPRECIATE GONZALEZ' PASSPORT NUMBER IF EMBASSY CAN OBTAIN IT. WOULD ALSO APPRECIATE EMBASSY COMMENT ON REASON FOR INTENSE GOES INTEREST IN GONZALEZ.
 
45
  #,gr.outputs.Textbox(label="Score")
46
  ],
47
  description=desc,
48
+ title=title
49
+ )
50
  demo.launch()