Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
liuzx 1c696c4b02 | 2 months ago | |
---|---|---|
.. | ||
image | 2 months ago | |
README.md | 2 months ago | |
api.py | 2 months ago | |
pcmind_7B_gradio.py | 2 months ago | |
pcmind_fastapi.py | 2 months ago |
本示例提供启智PCMIND大模型在线推理任务的webui方式和api方式
新建在线推理任务时选择以下参数:
模型:PCMind-7B-1T-Transformers
资源规格:1 * V100
镜像:192.168.204.22:5000/default-workspace/99280a9940ae44ca8f5892134386fddb/image:Llama3
启动文件:pcmind_7B_example/pcmind_7B_gradio.py
创建任务界面如下:
任务运行后,点击在线推理可查看服务界面如下:
#将Gradio的界面demo挂载到FastAPI应用程序app中,并使用环境变量OPENI_SELF_URL中指定的路径。
app = gr.mount_gradio_app(app, demo, path=os.getenv('OPENI_SELF_URL'))
uvicorn.run(app, host='0.0.0.0', port=int(os.getenv('OPENI_SELF_PORT')))
新建在线推理任务时选择以下参数:
模型:PCMind-7B-1T-Transformers
资源规格:1 * V100
镜像:192.168.204.22:5000/default-workspace/99280a9940ae44ca8f5892134386fddb/image:Llama3
启动文件:pcmind_7B_example/pcmind_fastapi.py
创建任务界面如下:
任务运行后,点击在线推理可查看api服务地址:
将推理地址最后面的 ?token 替换成 您自己定义的请求路由,比如/api/chat ,即为api接口地址,例如 https://mlunotebook.openi.org.cn/notebook_bff8721d68354db881d82a34c984dd6d_task0/api/chat
# 定义GET请求的路由
@app.get(os.getenv('OPENI_SELF_URL') + '/api/chat')
async def api_get():
return "This is a GET request."
# 启动
uvicorn.run(app, host='0.0.0.0', port=int(os.getenv('OPENI_SELF_PORT')))
本项目存放了利用启智云脑完成在线推理任务,旨在为AI开发者提供云脑在线推理任务的示例。
Python
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》