Spaces:
Build error
Build error
Commit
·
dd23ffe
1
Parent(s):
bb0476c
Update app.py
Browse files
app.py
CHANGED
@@ -28,8 +28,8 @@ def load_model():
|
|
28 |
nltk.download('omw-1.4')
|
29 |
## summary_mod_name = os.environ["summary_mod_name"]
|
30 |
## question_mod_name = os.environ["question_mod_name"]
|
31 |
-
summary_mod_name = 't5-
|
32 |
-
question_mod_name = 't5-
|
33 |
summary_model = T5ForConditionalGeneration.from_pretrained(summary_mod_name)
|
34 |
summary_tokenizer = T5Tokenizer.from_pretrained(summary_mod_name)
|
35 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
@@ -112,7 +112,6 @@ if raw_text != None and raw_text != '':
|
|
112 |
st.markdown(html_str , unsafe_allow_html=True)
|
113 |
st.markdown("-----")
|
114 |
questions.append(ques)
|
115 |
-
output_path = "results/df_quiz_log_file_v1.csv"
|
116 |
res_df = pd.DataFrame({"TimeStamp":[start_time]*len(ans_list),\
|
117 |
"Input":[str(raw_text)]*len(ans_list),\
|
118 |
"Question":questions,"Option1":option1,\
|
@@ -121,5 +120,4 @@ if raw_text != None and raw_text != '':
|
|
121 |
"Option4":option4,\
|
122 |
"Correct Answer":ans_list})
|
123 |
res_df.to_csv(output_path, mode='a', index=False, sep="\t", header= not os.path.exists(output_path))
|
124 |
-
# st.dataframe(pd.read_csv(output_path,sep="\t").tail(5))
|
125 |
-
csv_downloader(pd.read_csv(output_path,sep="\t"))
|
|
|
28 |
nltk.download('omw-1.4')
|
29 |
## summary_mod_name = os.environ["summary_mod_name"]
|
30 |
## question_mod_name = os.environ["question_mod_name"]
|
31 |
+
summary_mod_name = 'pszemraj/long-t5-tglobal-base-16384-book-summary'
|
32 |
+
question_mod_name = 'mrm8488/t5-base-finetuned-question-generation-ap'
|
33 |
summary_model = T5ForConditionalGeneration.from_pretrained(summary_mod_name)
|
34 |
summary_tokenizer = T5Tokenizer.from_pretrained(summary_mod_name)
|
35 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
112 |
st.markdown(html_str , unsafe_allow_html=True)
|
113 |
st.markdown("-----")
|
114 |
questions.append(ques)
|
|
|
115 |
res_df = pd.DataFrame({"TimeStamp":[start_time]*len(ans_list),\
|
116 |
"Input":[str(raw_text)]*len(ans_list),\
|
117 |
"Question":questions,"Option1":option1,\
|
|
|
120 |
"Option4":option4,\
|
121 |
"Correct Answer":ans_list})
|
122 |
res_df.to_csv(output_path, mode='a', index=False, sep="\t", header= not os.path.exists(output_path))
|
123 |
+
# st.dataframe(pd.read_csv(output_path,sep="\t").tail(5))
|
|