-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_question_generation.py
46 lines (35 loc) · 1.38 KB
/
run_question_generation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import streamlit as st
import SessionState
import json
import argparse
from question_generation_demo_ui import run_app
def rerun():
raise st.script_runner.RerunException(st.script_request_queue.RerunData(None))
def main(args):
# Use the full page instead of a narrow central column
st.set_page_config(page_title="Question Generation Demo", layout="wide", page_icon="favicon.png")
session_state = SessionState.get(isLoggedIn=False, logged_in_data=None)
if session_state.isLoggedIn:
run_app(args, session_state)
else:
logged_in_data = True
if bool(logged_in_data):
session_state.isLoggedIn = True
session_state.valid_list = []
#session_state.logged_in_data = format_login_data(logged_in_data)
session_state.logged_in_data = {
"name" : 'Test User',
"email" : 'test@test.com',
}
rerun()
if __name__ == "__main__":
parser = argparse.ArgumentParser(
description='Question Answering Demo',
epilog='Copyright Expert System Iberia 2021')
parser.add_argument(
'--question_generation_endpoint',
required=False,
default='http://localhost:8081/generate_questions',
help='Question Generation module API endpoint')
args = parser.parse_args()
main(args)