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

星火API接入错误 #4013

Open
zhangcheng0111 opened this issue May 14, 2024 · 2 comments
Open

星火API接入错误 #4013

zhangcheng0111 opened this issue May 14, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@zhangcheng0111
Copy link

问题描述 / Problem Description
用简洁明了的语言描述这个问题 / Describe the problem in a clear and concise manner.
使用docker拉取镜像,进入后配置星火API后重启,使用星火api显示错误
原因是server/model_workers/xinghuo.py的domain写错了,应该是generalv3.5而不是3

复现问题的步骤 / Steps to Reproduce

  1. 执行 '...' / Run '...'
  2. 点击 '...' / Click '...'
  3. 滚动到 '...' / Scroll to '...'
  4. 问题出现 / Problem occurs

预期的结果 / Expected Result
描述应该出现的结果 / Describe the expected result.

实际结果 / Actual Result
描述实际发生的结果 / Describe the actual result.

环境信息 / Environment Information

  • langchain-ChatGLM 版本/commit 号:(例如:v2.0.1 或 commit 123456) / langchain-ChatGLM version/commit number: (e.g., v2.0.1 or commit 123456)
  • 是否使用 Docker 部署(是/否):是 / Is Docker deployment used (yes/no): yes
  • 使用的模型(ChatGLM2-6B / Qwen-7B 等):ChatGLM-6B / Model used (ChatGLM2-6B / Qwen-7B, etc.): ChatGLM2-6B
  • 使用的 Embedding 模型(moka-ai/m3e-base 等):moka-ai/m3e-base / Embedding model used (moka-ai/m3e-base, etc.): moka-ai/m3e-base
  • 使用的向量库类型 (faiss / milvus / pg_vector 等): faiss / Vector library used (faiss, milvus, pg_vector, etc.): faiss
  • 操作系统及版本 / Operating system and version:
  • Python 版本 / Python version:
  • 其他相关环境信息 / Other relevant environment information:

附加信息 / Additional Information
添加与问题相关的任何其他信息 / Add any other information related to the issue.

@zhangcheng0111 zhangcheng0111 added the bug Something isn't working label May 14, 2024
@zhangcheng0111
Copy link
Author

此问题在源代码中也存在,并且在镜像中无法使用vi\vim\nano通过apt updates后apt install vim才可以使用,但是编辑python代码时候,还是会乱码,应该是需要配置下vim的编码才可以

Copy link

dosubot bot commented May 14, 2024

To address the encoding issues when editing Python files with Vim in the Docker environment, ensure Vim is configured to use UTF-8 encoding. Add these lines to your .vimrc:

set encoding=utf-8
set fileencoding=utf-8

This setup will help avoid syntax or encoding errors when working with Python files that include non-ASCII characters.

For the issue with the Xinghuo API integration in server/model_workers/xinghuo.py, specifically the incorrect domain version, you should update the version_mapping dictionary within the XingHuoWorker class. If the correct domain for version "v3.5" is "generalv3.5", modify it like so:

"v3.5": {"domain": "generalv3.5", "url": "ws://spark-api.xf-yun.com/v3.5/chat", "max_tokens": 16000},

This ensures the class uses the correct domain for API requests.

Regarding the Docker environment and the absence of text editors like vi, vim, or nano, it's common for Docker images, especially those optimized for production, to exclude such tools to minimize the image size and reduce potential security vulnerabilities. If you need to edit files within the Docker container, installing a text editor is necessary, but remember to configure it properly for handling Python files to avoid encoding issues.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant