提交 d82af9ba 作者: imClumsyPanda

update webui.py

上级 5a7973ea
......@@ -42,7 +42,7 @@ async def get_local_doc_qa():
@app.post("/file")
async def upload_file(UserFile: UploadFile=File(...)):
async def upload_file(UserFile: UploadFile=File(...),):
global vs_path
response = {
"msg": None,
......@@ -67,7 +67,7 @@ async def upload_file(UserFile: UploadFile=File(...)):
return response
@app.post("/qa")
async def get_answer(UserQuery: Query):
async def get_answer(query: str = ""):
response = {
"status": 0,
"message": "",
......@@ -76,7 +76,7 @@ async def get_answer(UserQuery: Query):
global vs_path
history = []
try:
resp, history = local_doc_qa.get_knowledge_based_answer(query=UserQuery.query,
resp, history = local_doc_qa.get_knowledge_based_answer(query=query,
vs_path=vs_path,
chat_history=history)
if REPLY_WITH_SOURCE:
......@@ -95,9 +95,9 @@ async def get_answer(UserQuery: Query):
if __name__ == "__main__":
uvicorn.run(
app='api:app',
app=app,
host='0.0.0.0',
port=8100,
reload = True,
reload=True,
)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论