pragnakalp commited on
Commit
282f138
·
1 Parent(s): 0ec8313

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -33,6 +33,7 @@ def generate_qna(context,input_radio,q1,q2,q3,q4,q5):
33
  def return_lan_para(radio_value):
34
  context = ""
35
  que_list = []
 
36
  if radio_value == 'English':
37
  context = '''Google was founded in 1998 by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University in California. Together they own about 14 percent of its shares and control 56 percent of the stockholder voting power through supervoting stock. They incorporated Google as a privately held company on September 4, 1998. An initial public offering (IPO) took place on August 19, 2004, and Google moved to its headquarters in Mountain View, California, nicknamed the Googleplex. In August 2015, Google announced plans to reorganize its various interests as a conglomerate called Alphabet Inc. Google is Alphabet's leading subsidiary and will continue to be the umbrella company for Alphabet's Internet interests. Sundar Pichai was appointed CEO of Google, replacing Larry Page who became the CEO of Alphabet.'''
38
  que_list=['Who is current CEO?','What is IPO?','Where is headquarter of Google?','','']
@@ -125,7 +126,7 @@ def return_lan_para(radio_value):
125
  que_list=["現在のCEOは誰ですか?","IPOとは何ですか?","IPOはいつ行われましたか?","Googleが設立されたのはいつですか?",
126
  "ラリーペイジとセルゲイブリンがどれだけ共有していますか?"]
127
 
128
- return context,que_list[0],que_list[1],que_list[2],que_list[3],que_list[4]
129
 
130
 
131
  with gr.Blocks(css=".gradio-container {background-color: lightgray}") as demo:
@@ -152,7 +153,7 @@ with gr.Blocks(css=".gradio-container {background-color: lightgray}") as demo:
152
  q5=gr.Textbox(label="Question 5")
153
  a5=gr.Textbox(label="Answer 5")
154
 
155
- input_radio.change(return_lan_para,input_radio,[input_text,q1,q2,q3,q4,q5])
156
  sub_btn.click(generate_qna, inputs=[input_text,input_radio,q1,q2,q3,q4,q5], outputs=[a1,a2,a3,a4,a5])
157
 
158
  demo.launch()
 
33
  def return_lan_para(radio_value):
34
  context = ""
35
  que_list = []
36
+ a1,a2,a3,a4,a5 = '','','','',''
37
  if radio_value == 'English':
38
  context = '''Google was founded in 1998 by Larry Page and Sergey Brin while they were Ph.D. students at Stanford University in California. Together they own about 14 percent of its shares and control 56 percent of the stockholder voting power through supervoting stock. They incorporated Google as a privately held company on September 4, 1998. An initial public offering (IPO) took place on August 19, 2004, and Google moved to its headquarters in Mountain View, California, nicknamed the Googleplex. In August 2015, Google announced plans to reorganize its various interests as a conglomerate called Alphabet Inc. Google is Alphabet's leading subsidiary and will continue to be the umbrella company for Alphabet's Internet interests. Sundar Pichai was appointed CEO of Google, replacing Larry Page who became the CEO of Alphabet.'''
39
  que_list=['Who is current CEO?','What is IPO?','Where is headquarter of Google?','','']
 
126
  que_list=["現在のCEOは誰ですか?","IPOとは何ですか?","IPOはいつ行われましたか?","Googleが設立されたのはいつですか?",
127
  "ラリーペイジとセルゲイブリンがどれだけ共有していますか?"]
128
 
129
+ return context,que_list[0],que_list[1],que_list[2],que_list[3],que_list[4],a1,a2,a3,a4,a5
130
 
131
 
132
  with gr.Blocks(css=".gradio-container {background-color: lightgray}") as demo:
 
153
  q5=gr.Textbox(label="Question 5")
154
  a5=gr.Textbox(label="Answer 5")
155
 
156
+ input_radio.change(return_lan_para,input_radio,[input_text,q1,q2,q3,q4,q5,a1,a2,a3,a4,a5])
157
  sub_btn.click(generate_qna, inputs=[input_text,input_radio,q1,q2,q3,q4,q5], outputs=[a1,a2,a3,a4,a5])
158
 
159
  demo.launch()