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

fix: correct the model list on the model provider's page #5043

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

Conversation

lc-soft
Copy link
Contributor

@lc-soft lc-soft commented Dec 16, 2024

💻 变更类型 | Change Type

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

🔀 变更说明 | Description of Change

模型列表去重时是以 / 后的名称作为唯一键的:
When deduplicating model lists, the name after the / is used as the unique key:

image

以 Qwen/Qwen2-7B-Instruct 为例,Gitee AI 中记录的模型 id 是 Qwen2-7B-Instruct,其它提供商的模型 id 是 Qwen/Qwen2-7B-Instruct,这种情况下,靠判断 item.identifier === id 是找不到 Gitee AI 的 Qwen2-7B-Instruct 模型详细的。

Using Qwen/Qwen2-7B-Instruct as an example, the model ID recorded in Gitee AI is Qwen2-7B-Instruct, while the model ID for other providers is Qwen/Qwen2-7B-Instruct. In this case, it is not possible to find detailed information about the Gitee AI's Qwen2-7B-Instruct model by determining that item.identifier === id.

因此,改成与 getModelList() 中相同的方式获取 id 再进行判断。
Therefore, it is changed to obtain the id in the same way as in getModelList() and then make a judgment.

📝 补充信息 | Additional Information

Before:

The total number of models is 4 +2

model-list-before

After:

The total number of models is 4 +10

model-list-after

Copy link

vercel bot commented Dec 16, 2024

@lc-soft is attempting to deploy a commit to the LobeHub Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Dec 16, 2024
@lobehubbot
Copy link
Member

👍 @lc-soft

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.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@dosubot dosubot bot added the 🐛 Bug Something isn't working | 缺陷 label Dec 16, 2024
@lc-soft lc-soft force-pushed the lc/fix-provider-model-list branch from 5859ddd to 0ef6ce7 Compare December 16, 2024 11:55
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.97%. Comparing base (c6d48e5) to head (0ef6ce7).
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #5043    +/-   ##
========================================
  Coverage   91.97%   91.97%            
========================================
  Files         548      548            
  Lines       41352    41355     +3     
  Branches     2513     2356   -157     
========================================
+ Hits        38032    38035     +3     
  Misses       3320     3320            
Flag Coverage Δ
app 91.97% <100.00%> (+<0.01%) ⬆️
server 98.12% <ø> (ø)

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.

Copy link

vercel bot commented Dec 16, 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 Dec 16, 2024 3:15pm

@canisminor1990
Copy link
Member

@lc-soft 影响到了其他 Provider ,尝试改成这样试试?

如:https://lobe-chat-preview-git-fork-lc-soft-l-50c801-lobe-chat-community.vercel.app/discover/provider/openrouter

let model = list.find((item) => {
      const ids = item.identifier.split('/');
      return ids[1] === id  || item.identifier === id;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants