Skip to content

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

Open
nalanqingcheng wants to merge 1 commit intoQwenLM:mainfrom
nalanqingcheng:main
Open

Qwen1.5适配OpenAI API接口的 openai_api.py#279
nalanqingcheng wants to merge 1 commit intoQwenLM:mainfrom
nalanqingcheng:main

Conversation

@nalanqingcheng
Copy link
Copy Markdown

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

@nalanqingcheng
Copy link
Copy Markdown
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
Copy Markdown

Rmnesia commented Apr 14, 2024

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

@Jacknolfskin
Copy link
Copy Markdown

流式输出不行

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
Copy Markdown

@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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

请问如何修改?

Copy link
Copy Markdown

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