andreska commited on
Commit
3c9bc24
·
verified ·
1 Parent(s): d5fa4b5

Try to fix bug where input was not provided

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -12,8 +12,9 @@ context = "Adrega is a very cool company, that implements AI" #dataset[0]["text"
12
  user_input = st.text_input('Ask me a question')
13
  if st.button("Submit"):
14
  if user_input:
15
- result = qa_pipeline(question=user_input, context=context)
16
- st.write(f"Adrega AI: {result['answer']}")
 
17
  else:
18
  st.write("Please enter a question.")
19
 
 
12
  user_input = st.text_input('Ask me a question')
13
  if st.button("Submit"):
14
  if user_input:
15
+ text_inputs = f"Context: {context}\nQuestion: {user_input}\nAnswer:"
16
+ result = pipe(text_inputs)[0]['generated_text']
17
+ st.write(f"Adrega AI: {result}"
18
  else:
19
  st.write("Please enter a question.")
20