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

Qwen1.5适配OpenAI API接口的 openai_api.py #279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nalanqingcheng
Copy link

Qwen1.5适配OpenAI API接口的 openai_api.py
实现openai的/v1/chat/completions聊天接口和/v1/embeddings文本向量化接口。
适配LangChain直接调用

@nalanqingcheng
Copy link
Author

Qwen1.5 adapted openai_api.py to the OpenAI API interface, implementing the /v1/chat/completions chat interface and the /v1/embeddings text vectorization interface. It is compatible with LangChain for direct invocation.

@Rmnesia
Copy link

Rmnesia commented Apr 14, 2024

Your code did not support .chat attribute. Please check 252 and make sure everything is implemented.

@Jacknolfskin
Copy link

流式输出不行

if query is _TEXT_COMPLETION_CMD:
response = text_complete_last_message(history, stop_words_ids=stop_words_ids, gen_kwargs=gen_kwargs)
else:
response, _ = model.chat(
Copy link

@CarryChang CarryChang Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数要改一下,Qwen2 移除了 chat

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数要改一下,Qwen2 移除了 chat

请问如何修改?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以参考我的代码, 我在Qwen1.5和Qwen2中重新实现了chat接口。#662

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

Successfully merging this pull request may close these issues.

6 participants