Merged
Conversation
modelscope_agent/llm/openai.py
Outdated
| return response.choices[0].message | ||
|
|
||
|
|
||
| @register_llm('openapi') |
Collaborator
Author
There was a problem hiding this comment.
上面的是openai,这个是openapi
modelscope_agent/llm/openai.py
Outdated
| class OpenAPILocal(BaseChatModel): | ||
|
|
||
| def __init__(self, model: str, model_server: str, **kwargs): | ||
| super().__init__(model, model_server) |
Contributor
There was a problem hiding this comment.
用户能用这个跑起来llama么?还是只能openapi?
Collaborator
Author
There was a problem hiding this comment.
是用这个跑,需要本地先通过vllm拉起一个openai格式的api
这个功能在modelscope中有提供https://www.modelscope.cn/docs/%E6%9C%AC%E5%9C%B0%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1
modelscope_agent/llm/openai.py
Outdated
|
|
||
|
|
||
| @register_llm('openapi') | ||
| class OpenAPILocal(BaseChatModel): |
Contributor
There was a problem hiding this comment.
openapilocal这个名字是指本地起一个openai的模型?还是调用本地vllm?后者的话名字要不要换?
wenmengzhou
approved these changes
Feb 4, 2024
zzhangpurdue
added a commit
that referenced
this pull request
Feb 26, 2024
* update * add style_repaint * 恢复 * 恢复 * add style_repaint tool * modify style_repaint * fix error * fix rate limit * improve stability * use dashscope to convert url * modify and better * fix * refact framework: add base class for llm, tool, and agent * refact llm * refact llm for custom * add role_play agent * add unittest for role-play agent * refactor/tool/image_gen * fix pre-commit * add agent_builder agent * revert modelscope_agent/agent.py * update agent and add react prompt * adapt agentbuilder in apps * update style_repaint * update style_repaint * change pipeline plugin tool (#248) * change pipeline plugin tool * Standardized input and output * Standardized input and output * Standardized input and output * refactor ms agent * save system to history * avoid duplicated system in roleplay * builder with history running * test case * update tool * update * modify import method * code interpreter and knowledge * running code interpreter with file * Refactor/citest (#257) * add citest * cache dependency * cache dependency update 1 * cache dependency update 2 * cache dependency update 3 --------- Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> * add modelscope tool (#258) * add modelscope tool * add modelscope tool * add modelscope tool --------- Co-authored-by: Zhicheng Zhang <zczhang.hvac@gmail.com> * unittest-web search web browser * update tool and unittest * Refactor/gradio4 (#260) * Feat/gradio4 (#229) * feat: update gradio 4 * feat: chatbot requirement * feat: update app.py to gradio 4 * fix: gradio 4 of process_configuration * fix: typo * fix: mschatbot * feat: chatbot support copy --------- Co-authored-by: nil.wyw <nil.wyw@alibaba-inc.com> * feat: update gradio 4 * feat: fileupload * feat: MultimodalInput for appBot * fix: ui * feat: MultimodalInput for app.py * feat: Textbox => MultimodalInput * bump version to 0.2.4rc0 * fix: lint * fix: lint * fix: lint * fix: lint * fix: add quotes for src prop (#249) * feat: update gradio 4 * feat: chatbot requirement * feat: update app.py to gradio 4 * fix: gradio 4 of process_configuration * fix: typo * fix: mschatbot * feat: chatbot support copy * feat: fileupload * fix: gradio 4 dataframe update * fix: appBot * fix: dataframe display when config update * fix: src format * fix: files path --------- Co-authored-by: nil.wyw <nil.wyw@alibaba-inc.com> * fix pre-commit * fix submit input. * fix multimodal * fix bugs & support appBot.py * fix pre-commit * fix auto-merge --------- Co-authored-by: wyw <1006629314@qq.com> Co-authored-by: nil.wyw <nil.wyw@alibaba-inc.com> Co-authored-by: Col0ring <1561999073@qq.com> Co-authored-by: wenmeng.zwm <wenmeng.zwm@alibaba-inc.com> Co-authored-by: Col0ring <47329987+Col0ring@users.noreply.github.com> Co-authored-by: suluyan.sly <suluyan.sly@alibaba-inc.com> Co-authored-by: skyline2006 <skyline2006@163.com> * update reame and tool cfg * Refactor/unittest (#264) * update unittest * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update ci * update ci * update ci * update ci * update ci * update ci * update ci * update ci * update ci * update ci * merge gradio4 * update ci * update ci * update ci * update ci * pass unit test * merge and pass unit test --------- Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> * merge origin master * fix bugs * fix video-to-image * add qwen-max * fix apps/agentfabric & update release version * apps/agentfabric/user_core.py * fix pre-commit * fix bugs & add video play for code interpreter * comment out translate * Refactor log (#268) * update logger * add dashscope log * update user log * add comment --------- Co-authored-by: ly119399 <ly119399@alibaba-inc.com> * Refactor/knowledgeretrieval (#271) * pass retrieval knowledge * add unit test * update requirements * pass lint * refact name * refact name --------- Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> * add logger (#272) * comment out translate * Refactor log (#268) * update logger * add dashscope log * update user log * add comment --------- Co-authored-by: ly119399 <ly119399@alibaba-inc.com> --------- Co-authored-by: skyline2006 <skyline2006@163.com> Co-authored-by: lylalala <liuyang070424@163.com> Co-authored-by: ly119399 <ly119399@alibaba-inc.com> Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> * pass code unittest * fix publish for missing MODELSCOPE_API_TOKEN alert & rm translation tool * fix bugs * update log * fix bugs * fix instruction * fix tool log * fix bugs * fix pre-commit * Zhipu-glm4 (#276) support zhipu glm-4 model --------- Co-authored-by: skyline2006 <skyline2006@163.com> Co-authored-by: Zhicheng Zhang <zczhang.hvac@gmail.com> * add zhipuai to requirements.txt * make sure .md file is parsed by nltk * Update demo 20240118 (#275) Co-authored-by: Jintao Huang <huangjintao.hjt@alibaba-inc.com> * add zhipuai * update retrieval knowledge logic to not load in agent fabric * update name * fix bugs * fix pre-commit * fix ci * update max_token setting * fix doc list extend method * fix ci * fix ci * add docstr * rm useless agent: function call, react, react_chat * bugfix * bugfix * bugfix: change _detect_tool for role_play * remove uuid related log in ms * fix publish avatar * version 0.3.0rc0 * fix bugs * fix bug * fix audio->video * update demo * bug fixed by comment * lint pass * bug fixed * bug fixed * fix ci (not complete) * add hf tool unit test * Openapi (#287) * feat: openapi * fix pre-commit * fix bugs --------- Co-authored-by: skyline2006 <skyline2006@163.com> Co-authored-by: suluyan <suluyan.sly@alibaba-inc.com> * bug fixed * pass lint * fix openapi bug --------- Co-authored-by: wangyijunlyy <1157637345@qq.com> Co-authored-by: tujianhong.tjh <tujianhong.tjh@alibaba-inc.com> Co-authored-by: suluyan.sly <suluyan.sly@alibaba-inc.com> Co-authored-by: Jianhong Tu <37433392+tuhahaha@users.noreply.github.com> Co-authored-by: mushenL <125954878+mushenL@users.noreply.github.com> Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> Co-authored-by: Zhicheng Zhang <zczhang.hvac@gmail.com> Co-authored-by: suluyana <110878454+suluyana@users.noreply.github.com> Co-authored-by: wyw <1006629314@qq.com> Co-authored-by: nil.wyw <nil.wyw@alibaba-inc.com> Co-authored-by: Col0ring <1561999073@qq.com> Co-authored-by: wenmeng.zwm <wenmeng.zwm@alibaba-inc.com> Co-authored-by: Col0ring <47329987+Col0ring@users.noreply.github.com> Co-authored-by: skyline2006 <skyline2006@163.com> Co-authored-by: ly119399 <ly119399@alibaba-inc.com> Co-authored-by: Jintao Huang <huangjintao.hjt@alibaba-inc.com>
zzhangpurdue
added a commit
that referenced
this pull request
Feb 27, 2024
* update * add style_repaint * 恢复 * 恢复 * add style_repaint tool * modify style_repaint * fix error * fix rate limit * improve stability * use dashscope to convert url * modify and better * fix * refact framework: add base class for llm, tool, and agent * refact llm * refact llm for custom * add role_play agent * add unittest for role-play agent * refactor/tool/image_gen * fix pre-commit * add agent_builder agent * revert modelscope_agent/agent.py * update agent and add react prompt * adapt agentbuilder in apps * update style_repaint * update style_repaint * change pipeline plugin tool (#248) * change pipeline plugin tool * Standardized input and output * Standardized input and output * Standardized input and output * refactor ms agent * save system to history * avoid duplicated system in roleplay * builder with history running * test case * update tool * update * modify import method * code interpreter and knowledge * running code interpreter with file * Refactor/citest (#257) * add citest * cache dependency * cache dependency update 1 * cache dependency update 2 * cache dependency update 3 --------- Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> * add modelscope tool (#258) * add modelscope tool * add modelscope tool * add modelscope tool --------- Co-authored-by: Zhicheng Zhang <zczhang.hvac@gmail.com> * unittest-web search web browser * update tool and unittest * Refactor/gradio4 (#260) * Feat/gradio4 (#229) * feat: update gradio 4 * feat: chatbot requirement * feat: update app.py to gradio 4 * fix: gradio 4 of process_configuration * fix: typo * fix: mschatbot * feat: chatbot support copy --------- Co-authored-by: nil.wyw <nil.wyw@alibaba-inc.com> * feat: update gradio 4 * feat: fileupload * feat: MultimodalInput for appBot * fix: ui * feat: MultimodalInput for app.py * feat: Textbox => MultimodalInput * bump version to 0.2.4rc0 * fix: lint * fix: lint * fix: lint * fix: lint * fix: add quotes for src prop (#249) * feat: update gradio 4 * feat: chatbot requirement * feat: update app.py to gradio 4 * fix: gradio 4 of process_configuration * fix: typo * fix: mschatbot * feat: chatbot support copy * feat: fileupload * fix: gradio 4 dataframe update * fix: appBot * fix: dataframe display when config update * fix: src format * fix: files path --------- Co-authored-by: nil.wyw <nil.wyw@alibaba-inc.com> * fix pre-commit * fix submit input. * fix multimodal * fix bugs & support appBot.py * fix pre-commit * fix auto-merge --------- Co-authored-by: wyw <1006629314@qq.com> Co-authored-by: nil.wyw <nil.wyw@alibaba-inc.com> Co-authored-by: Col0ring <1561999073@qq.com> Co-authored-by: wenmeng.zwm <wenmeng.zwm@alibaba-inc.com> Co-authored-by: Col0ring <47329987+Col0ring@users.noreply.github.com> Co-authored-by: suluyan.sly <suluyan.sly@alibaba-inc.com> Co-authored-by: skyline2006 <skyline2006@163.com> * update reame and tool cfg * Refactor/unittest (#264) * update unittest * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update requirements * update ci * update ci * update ci * update ci * update ci * update ci * update ci * update ci * update ci * update ci * merge gradio4 * update ci * update ci * update ci * update ci * pass unit test * merge and pass unit test --------- Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> * merge origin master * fix bugs * fix video-to-image * add qwen-max * fix apps/agentfabric & update release version * apps/agentfabric/user_core.py * fix pre-commit * fix bugs & add video play for code interpreter * comment out translate * Refactor log (#268) * update logger * add dashscope log * update user log * add comment --------- Co-authored-by: ly119399 <ly119399@alibaba-inc.com> * Refactor/knowledgeretrieval (#271) * pass retrieval knowledge * add unit test * update requirements * pass lint * refact name * refact name --------- Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> * add logger (#272) * comment out translate * Refactor log (#268) * update logger * add dashscope log * update user log * add comment --------- Co-authored-by: ly119399 <ly119399@alibaba-inc.com> --------- Co-authored-by: skyline2006 <skyline2006@163.com> Co-authored-by: lylalala <liuyang070424@163.com> Co-authored-by: ly119399 <ly119399@alibaba-inc.com> Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> * pass code unittest * fix publish for missing MODELSCOPE_API_TOKEN alert & rm translation tool * fix bugs * update log * fix bugs * fix instruction * fix tool log * fix bugs * fix pre-commit * Zhipu-glm4 (#276) support zhipu glm-4 model --------- Co-authored-by: skyline2006 <skyline2006@163.com> Co-authored-by: Zhicheng Zhang <zczhang.hvac@gmail.com> * add zhipuai to requirements.txt * make sure .md file is parsed by nltk * Update demo 20240118 (#275) Co-authored-by: Jintao Huang <huangjintao.hjt@alibaba-inc.com> * add zhipuai * update retrieval knowledge logic to not load in agent fabric * update name * fix bugs * fix pre-commit * fix ci * update max_token setting * fix doc list extend method * fix ci * fix ci * add docstr * rm useless agent: function call, react, react_chat * bugfix * bugfix * bugfix: change _detect_tool for role_play * remove uuid related log in ms * fix publish avatar * version 0.3.0rc0 * fix bugs * fix bug * fix audio->video * update demo * bug fixed by comment * lint pass * bug fixed * bug fixed * fix ci (not complete) * add hf tool unit test * Openapi (#287) * feat: openapi * fix pre-commit * fix bugs --------- Co-authored-by: skyline2006 <skyline2006@163.com> Co-authored-by: suluyan <suluyan.sly@alibaba-inc.com> * bug fixed * pass lint * fix openapi bug --------- Co-authored-by: wangyijunlyy <1157637345@qq.com> Co-authored-by: tujianhong.tjh <tujianhong.tjh@alibaba-inc.com> Co-authored-by: suluyan.sly <suluyan.sly@alibaba-inc.com> Co-authored-by: Jianhong Tu <37433392+tuhahaha@users.noreply.github.com> Co-authored-by: mushenL <125954878+mushenL@users.noreply.github.com> Co-authored-by: Zhicheng Zhang <zhangzhicheng.zzc@alibaba-inc.com> Co-authored-by: Zhicheng Zhang <zczhang.hvac@gmail.com> Co-authored-by: suluyana <110878454+suluyana@users.noreply.github.com> Co-authored-by: wyw <1006629314@qq.com> Co-authored-by: nil.wyw <nil.wyw@alibaba-inc.com> Co-authored-by: Col0ring <1561999073@qq.com> Co-authored-by: wenmeng.zwm <wenmeng.zwm@alibaba-inc.com> Co-authored-by: Col0ring <47329987+Col0ring@users.noreply.github.com> Co-authored-by: skyline2006 <skyline2006@163.com> Co-authored-by: ly119399 <ly119399@alibaba-inc.com> Co-authored-by: Jintao Huang <huangjintao.hjt@alibaba-inc.com> (cherry picked from commit 251b56f)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
支持本地以openai格式通过vllm拉起modelscope的模型进行访问