kenghuoxiong commited on
Commit
1528b5f
·
verified ·
1 Parent(s): 4292e9c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -87,11 +87,18 @@ qa = RetrievalQA.from_chain_type(
87
  return_source_documents=True
88
  )
89
 
90
- def chat(question, history):
 
 
 
 
 
 
 
91
  if len(history) == 0:
92
- response = qa.invoke(question)['result']
93
  else:
94
- response = qwen_api(question, gradio_history=history)
95
  print(response)
96
  yield response
97
  return response
 
87
  return_source_documents=True
88
  )
89
 
90
+ def chat(
91
+ message,
92
+ history: list[tuple[str, str]],
93
+ system_message,
94
+ max_tokens,
95
+ temperature,
96
+ top_p,
97
+ )):
98
  if len(history) == 0:
99
+ response = qa.invoke(message)['result']
100
  else:
101
+ response = qwen_api(message, gradio_history=history)
102
  print(response)
103
  yield response
104
  return response