akdeniz27 commited on
Commit
3a6b5f6
1 Parent(s): 2148dd6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -44,16 +44,18 @@ context_1 = st.text_area("Context #1", text_1, height=128)
44
  context_2 = st.text_area("Context #2", text_2, height=128)
45
  context_3 = st.text_area("New Context", value="", height=128)
46
 
47
- selected_context = st.radio("Select Context", ("Context #1", "Context #2", "New Context"))
48
 
49
- if selected_context == "Context #1":
 
50
  selected_question = st.radio("Select Question", question_list_1)
51
- elif selected_context == "Context #2":
 
52
  selected_question = st.radio("Select Question", question_list_2)
53
- elif selected_context == "New Context":
 
54
  selected_question = st.text_area("New Question", value="", height=64)
55
 
56
-
57
  def setModel(model_checkpoint):
58
  model = AutoModelForQuestionAnswering.from_pretrained(model_checkpoint)
59
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
 
44
  context_2 = st.text_area("Context #2", text_2, height=128)
45
  context_3 = st.text_area("New Context", value="", height=128)
46
 
47
+ context = st.radio("Select Context", ("Context #1", "Context #2", "New Context"))
48
 
49
+ if context == "Context #1":
50
+ selected_context = context_1
51
  selected_question = st.radio("Select Question", question_list_1)
52
+ elif context == "Context #2":
53
+ selected_context = context_2
54
  selected_question = st.radio("Select Question", question_list_2)
55
+ elif context == "New Context":
56
+ selected_context = context_3
57
  selected_question = st.text_area("New Question", value="", height=64)
58
 
 
59
  def setModel(model_checkpoint):
60
  model = AutoModelForQuestionAnswering.from_pretrained(model_checkpoint)
61
  tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)