aidan-o-brien commited on
Commit
8fbe78b
·
1 Parent(s): c78eaed

allow for changing index example

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -62,12 +62,13 @@ with st.expander("Upload csv file"):
62
  uploaded_file = st.file_uploader("Choose a csv file", type="csv", key='file_uploader')
63
 
64
 
65
- # If file is uploaded, run inference - QA pipelines can't run batch ATM
66
  if uploaded_file is not None:
67
  df = load_data(uploaded_file)
68
 
69
  # Run inference on first example
70
- first_example = df['review'][0]
 
71
  question = "How was the recipe improved?"
72
  resp = question_answer(question=question,
73
  context=first_example,
 
62
  uploaded_file = st.file_uploader("Choose a csv file", type="csv", key='file_uploader')
63
 
64
 
65
+ # If file is uploaded, run inference - QA pipelines can't run batch
66
  if uploaded_file is not None:
67
  df = load_data(uploaded_file)
68
 
69
  # Run inference on first example
70
+ user_idx = st.text_input('Enter index')
71
+ first_example = df['review'][int(user_idx)]
72
  question = "How was the recipe improved?"
73
  resp = question_answer(question=question,
74
  context=first_example,