pragnakalp commited on
Commit
7de25cf
·
1 Parent(s): 44b114c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -20,6 +20,7 @@ DATA_FILENAME = "que_gen_logs.csv"
20
  DATA_FILE = os.path.join("que_gen_logs", DATA_FILENAME)
21
  DATASET_REPO_ID = "pragnakalp/Question_Generation_T5"
22
  print("is none?", HF_TOKEN is None)
 
23
  # REPOSITORY_DIR = "data"
24
  # LOCAL_DIR = 'data_local'
25
  # os.makedirs(LOCAL_DIR,exist_ok=True)
@@ -69,7 +70,7 @@ def generate_questions(article,num_que):
69
  result = ''
70
  try:
71
  if num_que == None or num_que == '':
72
- num_que = 5
73
  else:
74
  num_que = num_que
75
  generated_questions_list = qg.generate(article, num_questions=int(num_que))
@@ -119,7 +120,7 @@ def save_data_and_sendmail(article,generated_questions,num_que,result):
119
  return "Successfully save data"
120
 
121
  ## design 1
122
- inputs=gr.Textbox(lines=5, label="Article/Text",elem_id="inp_div")
123
  total_que = gr.Textbox(label="Number of Question want to generate",elem_id="inp_div")
124
  outputs=gr.Textbox(lines=5, label="Generated Questions",elem_id="inp_div")
125
 
 
20
  DATA_FILE = os.path.join("que_gen_logs", DATA_FILENAME)
21
  DATASET_REPO_ID = "pragnakalp/Question_Generation_T5"
22
  print("is none?", HF_TOKEN is None)
23
+ article_value = """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."""
24
  # REPOSITORY_DIR = "data"
25
  # LOCAL_DIR = 'data_local'
26
  # os.makedirs(LOCAL_DIR,exist_ok=True)
 
70
  result = ''
71
  try:
72
  if num_que == None or num_que == '':
73
+ num_que = 3
74
  else:
75
  num_que = num_que
76
  generated_questions_list = qg.generate(article, num_questions=int(num_que))
 
120
  return "Successfully save data"
121
 
122
  ## design 1
123
+ inputs=gr.Textbox(value=article_value, lines=5, label="Article/Text",elem_id="inp_div")
124
  total_que = gr.Textbox(label="Number of Question want to generate",elem_id="inp_div")
125
  outputs=gr.Textbox(lines=5, label="Generated Questions",elem_id="inp_div")
126