Spaces:
Runtime error
Runtime error
Commit
·
9ab3547
1
Parent(s):
be83449
Update main.py
Browse files
main.py
CHANGED
|
@@ -48,12 +48,9 @@ def chat():
|
|
| 48 |
data = request.get_json()
|
| 49 |
#user_query = data['query']
|
| 50 |
#此处的['query']中的query可以自定义名称,例如修改为user_question,那么调用API的代码中,需要相应的使用data = {'user_question': user_query},user_question需一致
|
| 51 |
-
user_query = data['user_question']
|
| 52 |
-
#temp_user_query=user_query
|
| 53 |
# 调用Chatbot
|
| 54 |
initial_response = llm_chain.run(user_query)
|
| 55 |
-
#st.write("AI Response")
|
| 56 |
-
#st.write(initial_response)
|
| 57 |
return jsonify({'response': initial_response})
|
| 58 |
|
| 59 |
#if __name__ == "__main__":
|
|
|
|
| 48 |
data = request.get_json()
|
| 49 |
#user_query = data['query']
|
| 50 |
#此处的['query']中的query可以自定义名称,例如修改为user_question,那么调用API的代码中,需要相应的使用data = {'user_question': user_query},user_question需一致
|
| 51 |
+
user_query = data['user_question']
|
|
|
|
| 52 |
# 调用Chatbot
|
| 53 |
initial_response = llm_chain.run(user_query)
|
|
|
|
|
|
|
| 54 |
return jsonify({'response': initial_response})
|
| 55 |
|
| 56 |
#if __name__ == "__main__":
|