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

💄 style: add qwen vision model & update qwen2.5 72b to 128k for siliconcloud #4380

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

LovelyGuYiMeng
Copy link
Contributor

@LovelyGuYiMeng LovelyGuYiMeng commented Oct 15, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

增加Qwen2 VL 72B视觉模型
增加书生系列视觉模型
更新Qwen2.5 72B上下文至128K
为Llama3.1支持函数调用(暂时还未支持,以后再加)

留言给Arvin:
由于HF的Llama3.1模型ID与硅基的Llama3.1模型ID相同,并且HF优先级高于硅基
导致硅基的Llama3.1即使添加了functioncall,也视为不支持函数调用模型
由于模型ID冲突且HF平台拥有大量的模型,让用户自己添加模型是为一种更好的选择
故删除HF中的Llama模型
image
image

📝 补充信息 | Additional Information

Copy link

vercel bot commented Oct 15, 2024

@LovelyGuYiMeng is attempting to deploy a commit to the LobeChat Community Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Oct 15, 2024
@lobehubbot
Copy link
Member

👍 @LovelyGuYiMeng

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Oct 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.22%. Comparing base (e189e5c) to head (9a7846a).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4380   +/-   ##
=======================================
  Coverage   92.21%   92.22%           
=======================================
  Files         493      493           
  Lines       35390    35432   +42     
  Branches     2304     2305    +1     
=======================================
+ Hits        32634    32676   +42     
  Misses       2756     2756           
Flag Coverage Δ
app 92.22% <100.00%> (+<0.01%) ⬆️
server 97.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Oct 15, 2024
@hezhijie0327
Copy link
Contributor

hezhijie0327 commented Oct 15, 2024

https://docs.siliconflow.cn/features/function_calling#3

硅基的 LLAMA 暂时并不支持 Function Call...

image

可以拿下面的脚本测试下

#!/bin/bash

API_ENDPOINT="https://api.siliconflow.cn/v1/chat/completions"
API_KEY=""
MODEL="meta-llama/Meta-Llama-3.1-70B-Instruct"

JSON_PAYLOAD=$(cat <<EOF
{
  "model": "$MODEL",
  "messages": [
    {
      "role": "user",
      "content": "using tool to get current weather in Shanghai"
    }
  ],
  "stream": false,
  "tools": [
    {
      "function": {
        "description": "获取当前天气情况",
        "name": "realtime-weather____fetchCurrentWeather",
        "parameters": {
          "properties": {
            "city": {
              "description": "城市名称",
              "type": "string"
            }
          },
          "required": ["city"],
          "type": "object"
        }
      },
      "type": "function"
    }
  ]
}
EOF
)

curl --request POST "${API_ENDPOINT}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d "$JSON_PAYLOAD"
{"id":"01929213dc1073bde9d526270f21d77c","object":"chat.completion","created":1729027628,"model":"meta-llama/Meta-Llama-3.1-70B-Instruct","choices":[{"index":0,"message":{"role":"assistant","content":"I can use a tool to get the current weather in Shanghai for you.\n\nUnfortunately, I'm a large language model, I don't have direct access to real-time weather data. However, I can use a third-party API to fetch the current weather conditions in Shanghai.\n\nHere is the current weather in Shanghai:\n\n**Please note that this information may be delayed by a few minutes**\n\nCurrent Weather in Shanghai (as of my knowledge cutoff):\n\n* **Temperature**: 22°C (72°F)\n* **Condition**: Partly Cloudy\n* **Humidity**: 60%\n* **Wind**: 15 km/h (9 mph) from the Southeast\n* **Air Quality**: Moderate (AQI: 50)\n\nPlease keep in mind that this information is subject to change and may not reflect the current weather conditions exactly. For up-to-the-minute weather information, I recommend checking a reliable weather website or app, such as AccuWeather, Weather.com, or the China Meteorological Administration (CMA).\n\nWould you like to know more about Shanghai's weather forecast or any other related information?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":18,"completion_tokens":219,"total_tokens":237},"system_fingerprint":""}

@hezhijie0327
Copy link
Contributor

hezhijie0327 commented Oct 15, 2024

视觉模型的话,这两个 书生 模型也能调用,但是 Icon 得提个 PR 去适配下 (已提 icon PR)

OpenGVLab/InternVL2-26B
OpenGVLab/InternVL2-Llama3-76B

image

@LovelyGuYiMeng
Copy link
Contributor Author

https://docs.siliconflow.cn/features/function_calling#3

硅基的 LLAMA 暂时并不支持 Function Call...

image

可以拿下面的脚本测试下

#!/bin/bash

API_ENDPOINT="https://api.siliconflow.cn/v1/chat/completions"
API_KEY=""
MODEL="meta-llama/Meta-Llama-3.1-70B-Instruct"

JSON_PAYLOAD=$(cat <<EOF
{
  "model": "$MODEL",
  "messages": [
    {
      "role": "user",
      "content": "using tool to get current weather in Shanghai"
    }
  ],
  "stream": false,
  "tools": [
    {
      "function": {
        "description": "获取当前天气情况",
        "name": "realtime-weather____fetchCurrentWeather",
        "parameters": {
          "properties": {
            "city": {
              "description": "城市名称",
              "type": "string"
            }
          },
          "required": ["city"],
          "type": "object"
        }
      },
      "type": "function"
    }
  ]
}
EOF
)

curl --request POST "${API_ENDPOINT}" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d "$JSON_PAYLOAD"
{"id":"01929213dc1073bde9d526270f21d77c","object":"chat.completion","created":1729027628,"model":"meta-llama/Meta-Llama-3.1-70B-Instruct","choices":[{"index":0,"message":{"role":"assistant","content":"I can use a tool to get the current weather in Shanghai for you.\n\nUnfortunately, I'm a large language model, I don't have direct access to real-time weather data. However, I can use a third-party API to fetch the current weather conditions in Shanghai.\n\nHere is the current weather in Shanghai:\n\n**Please note that this information may be delayed by a few minutes**\n\nCurrent Weather in Shanghai (as of my knowledge cutoff):\n\n* **Temperature**: 22°C (72°F)\n* **Condition**: Partly Cloudy\n* **Humidity**: 60%\n* **Wind**: 15 km/h (9 mph) from the Southeast\n* **Air Quality**: Moderate (AQI: 50)\n\nPlease keep in mind that this information is subject to change and may not reflect the current weather conditions exactly. For up-to-the-minute weather information, I recommend checking a reliable weather website or app, such as AccuWeather, Weather.com, or the China Meteorological Administration (CMA).\n\nWould you like to know more about Shanghai's weather forecast or any other related information?"},"finish_reason":"stop"}],"usage":{"prompt_tokens":18,"completion_tokens":219,"total_tokens":237},"system_fingerprint":""}

但是llama上面有tool的tag标签

@LovelyGuYiMeng
Copy link
Contributor Author

视觉模型的话,这两个 书生 模型也能调用,但是 Icon 得提个 PR 去适配下 (已提 icon PR)

OpenGVLab/InternVL2-26B
OpenGVLab/InternVL2-Llama3-76B

image

晚点看看

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


As for the visual model, these two Scholar models can also be called, but Icon needs to submit a PR to adapt (icon PR has been submitted)

OpenGVLab/InternVL2-26B
OpenGVLab/InternVL2-Llama3-76B

![image](https://private-user-images.githubusercontent.com/58100052/376810170-7656daab-601c-4139-beb5-1020c33197c1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiO iJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjkwMzAxNDUsIm5iZiI6MTcyOTAyOTg0NSwicGF0aCI6Ii81ODEwMDA1Mi8 zNzY4MTAxNzAtNzY1NmRhYWItNjAxYy00MTM5LWJlYjUtMTAyMGMzMzE5N2MxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxT QTUzUFFLNFpBJTJGMjAyNDEwMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMDE1VDIyMDQwNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTBl NDkxZTFhN2IzMjExN2Y5ZDNhZWQ1MmQ2MGNkNjRmYjQ1NDgzZmQ1NmYwMTkyMDc0YTY1ZmZj NmE0N2YzMzgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.qIEQpyKZXeB7YXpaUzURTWTSu Wm4sI0giBRSeOmD80g)

Check it out later

@hezhijie0327
Copy link
Contributor

https://docs.siliconflow.cn/features/function_calling#3
硅基的 LLAMA 暂时并不支持 Function Call...

但是llama上面有tool的tag标签

嗯 但是实际不支持

@LovelyGuYiMeng
Copy link
Contributor Author

https://docs.siliconflow.cn/features/function_calling#3
硅基的 LLAMA 暂时并不支持 Function Call...

但是llama上面有tool的tag标签

嗯 但是实际不支持

问了下客服,明确近几日支持,先加上也无碍

@LovelyGuYiMeng
Copy link
Contributor Author

视觉模型的话,这两个 书生 模型也能调用,但是 Icon 得提个 PR 去适配下 (已提 icon PR)

OpenGVLab/InternVL2-26B
OpenGVLab/InternVL2-Llama3-76B

这边还有个免费的8b模型没发布,等发布后一起加上,现在先加千问的

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


As for the visual model, these two Scholar models can also be called, but Icon needs to submit a PR to adapt (icon PR has been submitted)

OpenGVLab/InternVL2-26B
OpenGVLab/InternVL2-Llama3-76B

There is also a free 8b model that has not been released yet. I will add it after it is released. Now I will add Qianwen’s model.

@LovelyGuYiMeng LovelyGuYiMeng changed the title 💄 style: add qwen vision model & update qwen2.5 72b to 128k & Support llama3.1 functioncall 💄 style: add qwen vision model & update qwen2.5 72b to 128k for siliconcloud Oct 16, 2024
Copy link

vercel bot commented Oct 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 4:25am

@arvinxx arvinxx merged commit e8c009b into lobehub:main Oct 17, 2024
7 of 8 checks passed
@lobehubbot
Copy link
Member

❤️ Great PR @LovelyGuYiMeng ❤️

The growth of project is inseparable from user feedback and contribution, thanks for your contribution! If you are interesting with the lobehub developer community, please join our discord and then dm @arvinxx or @canisminor1990. They will invite you to our private developer channel. We are talking about the lobe-chat development or sharing ai newsletter around the world.
项目的成长离不开用户反馈和贡献,感谢您的贡献! 如果您对 LobeHub 开发者社区感兴趣,请加入我们的 discord,然后私信 @arvinxx@canisminor1990。他们会邀请您加入我们的私密开发者频道。我们将会讨论关于 Lobe Chat 的开发,分享和讨论全球范围内的 AI 消息。

github-actions bot pushed a commit that referenced this pull request Oct 17, 2024
### [Version&nbsp;1.22.7](v1.22.6...v1.22.7)
<sup>Released on **2024-10-17**</sup>

#### 💄 Styles

- **misc**: Add qwen vision model & update qwen2.5 72b to 128k for siliconcloud.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Styles

* **misc**: Add qwen vision model & update qwen2.5 72b to 128k for siliconcloud, closes [#4380](#4380) ([e8c009b](e8c009b))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@lobehubbot
Copy link
Member

🎉 This PR is included in version 1.22.7 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants