bhaskartripathi commited on
Commit
d3f4918
·
1 Parent(s): d911e51

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -17,12 +17,12 @@ qg = QuestionGenerator()
17
 
18
  HF_TOKEN = os.environ.get("HF_TOKEN")
19
  DATASET_NAME = "question_generation_T5_dataset"
20
- DATASET_REPO_URL = f"https://huggingface.co/datasets/pragnakalp/{DATASET_NAME}"
21
  DATA_FILENAME = "que_gen_logs.csv"
22
  DATA_FILE = os.path.join("que_gen_logs", DATA_FILENAME)
23
- DATASET_REPO_ID = "pragnakalp/question_generation_T5_dataset"
24
  print("is none?", HF_TOKEN is None)
25
- 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."""
26
  # REPOSITORY_DIR = "data"
27
  # LOCAL_DIR = 'data_local'
28
  # os.makedirs(LOCAL_DIR,exist_ok=True)
@@ -63,7 +63,7 @@ def get_location(ip_addr):
63
  "ip":ip,
64
  "token":"pkml123"
65
  }
66
- url = "https://demos.pragnakalp.com/get-ip-location"
67
 
68
  # req_data=json.dumps(req_data)
69
  # print("req_data",req_data)
@@ -117,8 +117,8 @@ def save_data_and_sendmail(article,generated_questions,num_que):
117
  commit_url = repo.push_to_hub()
118
  print("commit data :",commit_url)
119
 
120
- url = 'https://pragnakalpdev35.pythonanywhere.com/HF_space_que_gen'
121
- # url = 'http://pragnakalpdev33.pythonanywhere.com/HF_space_question_generator'
122
  myobj = {'article': article,'total_que': num_que,'gen_que':generated_questions,'ip_addr':ip_address,'loc':location}
123
  x = requests.post(url, json = myobj)
124
  print("myobj^^^^^",myobj)
@@ -139,8 +139,8 @@ demo = gr.Interface(
139
  outputs,
140
  title="Question Generation Using T5-Base Model",
141
  css=".gradio-container {background-color: lightgray} #inp_div {background-color: #7FB3D5;}",
142
- article="""<p style='text-align: center;'>Feel free to give us your <a href="https://www.pragnakalp.com/contact/" target="_blank">feedback</a> on this Question Generation using T5 demo.</p>
143
- <p style='text-align: center;'>Developed by: <a href="https://www.pragnakalp.com" target="_blank">Pragnakalp Techlabs</a></p>"""
144
 
145
  )
146
  demo.launch()
 
17
 
18
  HF_TOKEN = os.environ.get("HF_TOKEN")
19
  DATASET_NAME = "question_generation_T5_dataset"
20
+ DATASET_REPO_URL = f"https://huggingface.co/spaces/bhaskartripathi/Text2Question/{DATASET_NAME}"
21
  DATA_FILENAME = "que_gen_logs.csv"
22
  DATA_FILE = os.path.join("que_gen_logs", DATA_FILENAME)
23
+ DATASET_REPO_ID = "bhaskartripathi/Text2Question"
24
  print("is none?", HF_TOKEN is None)
25
+ article_value = """Affecting computing is an artificial intelligence area of study that recognizes, interprets, processes, and simulates human affects. The user’s emotional states can be sensed through electroencephalography (EEG)-based Brain Computer Interfaces (BCI) devices. Research in emotion recognition using these tools is a rapidly growing field with multiple inter-disciplinary applications. This article performs a survey of the pertinent scientific literature from 2015 to 2020. It presents trends and a comparative analysis of algorithm applications in new implementations from a computer science perspective. Our survey gives an overview of datasets, emotion elicitation methods, feature extraction and selection, classification algorithms, and performance evaluation. Lastly, we provide insights for future developments."""
26
  # REPOSITORY_DIR = "data"
27
  # LOCAL_DIR = 'data_local'
28
  # os.makedirs(LOCAL_DIR,exist_ok=True)
 
63
  "ip":ip,
64
  "token":"pkml123"
65
  }
66
+ url = "https://bhaskartripathi.com/get-ip-location"
67
 
68
  # req_data=json.dumps(req_data)
69
  # print("req_data",req_data)
 
117
  commit_url = repo.push_to_hub()
118
  print("commit data :",commit_url)
119
 
120
+ url = 'https://bhaskartripathi.com/HF_space_que_gen'
121
+
122
  myobj = {'article': article,'total_que': num_que,'gen_que':generated_questions,'ip_addr':ip_address,'loc':location}
123
  x = requests.post(url, json = myobj)
124
  print("myobj^^^^^",myobj)
 
139
  outputs,
140
  title="Question Generation Using T5-Base Model",
141
  css=".gradio-container {background-color: lightgray} #inp_div {background-color: #7FB3D5;}",
142
+ article="""<p style='text-align: center;'><a href="https://github.com/bhaskatripathi/QuestAnsGenerator/issues" target="_blank">Raise Issues</a></p>
143
+ <p style='text-align: center;'>MultiCloud4U Sandbox Env <a href="https://www.multicloud4u.com" target="_blank">Multicloud4U Technologies Pvt. Ltd.</a></p>"""
144
 
145
  )
146
  demo.launch()