Spaces:
Runtime error
Runtime error
Commit
·
6485c24
1
Parent(s):
399d884
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,8 @@ def call_chatbot_api(query):
|
|
| 5 |
url = 'https://hf-aichat-api.onrender.com/api/chat' #OKed
|
| 6 |
# url = 'https://hf-aichatboapi.onrender.com/api/chat' #Failed
|
| 7 |
# url = 'https://newaichatapi.onrender.com/api/chat' #Failed: JSONDecodeError: Expecting value: line 1 column 1 (char 0)
|
|
|
|
|
|
|
| 8 |
#data = {'query': query}
|
| 9 |
#在API设置中,将#user_query = data['query']中的query修改为user_question,因此在此处的API调用代码中,需要相应的使用data = {'user_question': query}
|
| 10 |
json_data_for_api = {'user_question': query}
|
|
|
|
| 5 |
url = 'https://hf-aichat-api.onrender.com/api/chat' #OKed
|
| 6 |
# url = 'https://hf-aichatboapi.onrender.com/api/chat' #Failed
|
| 7 |
# url = 'https://newaichatapi.onrender.com/api/chat' #Failed: JSONDecodeError: Expecting value: line 1 column 1 (char 0)
|
| 8 |
+
#这两个失败的原因是因为其中使用了st.chat_message、st.markdown等st命令,而将其部署到Render的时候,使用的是gunicorn newAIChatAPI:app命令,没有streamlit run,所以会导致这些命令无法执行
|
| 9 |
+
#自然程序就不会有输出结果了!因此会遇到这个问题:JSONDecodeError: Expecting value: line 1 column 1 (char 0);<Response [500]>或<Response [404]>
|
| 10 |
#data = {'query': query}
|
| 11 |
#在API设置中,将#user_query = data['query']中的query修改为user_question,因此在此处的API调用代码中,需要相应的使用data = {'user_question': query}
|
| 12 |
json_data_for_api = {'user_question': query}
|