Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前端跨域问题[BUG] <title> #188

Open
2 tasks done
c123853648 opened this issue Mar 21, 2024 · 3 comments
Open
2 tasks done

前端跨域问题[BUG] <title> #188

c123853648 opened this issue Mar 21, 2024 · 3 comments

Comments

@c123853648
Copy link

c123853648 commented Mar 21, 2024

是否已有关于该错误的issue或讨论? | Is there an existing issue / discussion for this?

  • 我已经搜索过已有的issues和讨论 | I have searched the existing issues / discussions

该问题是否在FAQ中有解答? | Is there an existing answer for this in FAQ?

  • 我已经搜索过FAQ | I have searched FAQ

当前行为 | Current Behavior

Linux服务器运行了chatglm3-6b-int4 模型,模型以openai-api方式运行。

GPUID1=0, GPUID2=0, device_id=0
Do you want to use the previous OPENAI_API_KEY: EMPTY? (yes/no) 是否使用上次的OPENAI_API_KEY: EMPTY?(yes/no) 回车默认选yes,请输入:no
Please enter OPENAI_API_KEY: EMPTY
Please enter OPENAI_API_BASE (default: https://api.openai.com/v1):http://10.1.xx.11:8000/v1
Please enter OPENAI_API_MODEL_NAME (default: gpt-3.5-turbo):chatglm3-6b-int4
Please enter OPENAI_API_CONTEXT_LENGTH (default: 4096):4096
llm_api is set to [cloud]
device_id is set to [0]
runtime_backend is set to [default]
model_name is set to []
conv_template is set to []
tensor_parallel is set to [1]
gpu_memory_utilization is set to [0.81]
Do you want to use the previous ip: 10.1.xx.11? (yes/no) 是否使用上次的ip: ?(yes/no) 回车默认选yes,请输入:
Running under native Linux
……
qanything-container-local  | Time elapsed: 53 seconds.
qanything-container-local  | 已耗时: 53 秒.
qanything-container-local  | Please visit the front-end service at [http://10.1.xx.11:5052/qanything/] to conduct Q&A.
qanything-container-local  | 请在[http://10.1.xx.11:5052/qanything/]下访问前端服务来进行问答,如果前端报错,请在浏览器按F12以获取更多报错信息

正常启动了,然后在同局域网的pc机中访问http://10.1.xx.11:5052/qanything#/home,可以访问,上传知识库后进行问答时,出现了跨域问题

Access to fetch at 'http://10.1.xx.11:8777/api/local_doc_qa/local_doc_chat' from origin 'http://10.1.xx.11:5052' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.      
POST http://10.1.xx.11:8777/api/local_doc_qa/local_doc_chat net::ERR_FAILED 500 (Internal Server Error)

期望行为 | Expected Behavior

No response

运行环境 | Environment

- OS:
- NVIDIA Driver:
- CUDA:
- docker:
- docker-compose:
- NVIDIA GPU:
- NVIDIA GPU Memory:24G

QAnything日志 | QAnything logs

No response

复现方法 | Steps To Reproduce

No response

备注 | Anything else?

No response

@23357
Copy link

23357 commented Apr 9, 2024

我也出现这个问题,看后台是有允许跨域头了,xhr请求就可以,fetch不行

@successren
Copy link
Collaborator

successren commented Apr 9, 2024

v1.3.3 has resoved this issue, please pull latest code to try again!
more infomations see: https://github.com/netease-youdao/QAnything/releases/tag/v1.3.3

@GreatStep
Copy link

—— 没解决么

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants