amn-sdqi commited on
Commit
06c730a
·
1 Parent(s): 0d777b1

updated prompt

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -46,13 +46,13 @@ if st.session_state.context:
46
 
47
  if question:
48
  result = qa(question=question, context=st.session_state.context)
49
- text_gen_res = text_gen(
50
- result["answer"],
51
- max_length=30,
52
- )
53
  # save convo
54
  st.session_state.chat_history.append(
55
- {"user": question, "bot": text_gen_res["generated_text"]}
56
  )
57
 
58
  # Display chat
 
46
 
47
  if question:
48
  result = qa(question=question, context=st.session_state.context)
49
+
50
+ prompt = f"{question}\n{result['answer']}"
51
+ generated = text_gen(prompt, max_length=100, do_sample=True)[0]['generated_text']
52
+
53
  # save convo
54
  st.session_state.chat_history.append(
55
+ {"user": question, "bot": generated}
56
  )
57
 
58
  # Display chat