-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
base: main
Are you sure you want to change the base?
Conversation
@lc-soft is attempting to deploy a commit to the LobeHub Team on Vercel. A member of the Team first needs to authorize it. |
๐ @lc-soft Thank you for raising your pull request and contributing to our Community |
5859ddd
to
0ef6ce7
Compare
Codecov ReportAll modified and coverable lines are covered by tests โ
Additional details and impacted files@@ Coverage Diff @@
## main #5043 +/- ##
==========================================
+ Coverage 91.96% 98.14% +6.17%
==========================================
Files 548 12 -536
Lines 41463 2913 -38550
Branches 2517 154 -2363
==========================================
- Hits 38132 2859 -35273
+ Misses 3331 54 -3277
Flags with carried forward coverage won't be shown. Click here to find out more. โ View full report in Codecov by Sentry. |
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
|
@lc-soft ๅฝฑๅๅฐไบๅ ถไป Provider ๏ผๅฐ่ฏๆนๆ่ฟๆ ท่ฏ่ฏ๏ผ let model = list.find((item) => {
const ids = item.identifier.split('/');
return ids[1] === id || item.identifier === id;
}); |
0ef6ce7
to
1a492ec
Compare
ๆนไบใ ๆๆต่ฏๆถ็ๅฐๆไบ id ๅ
ๅซๅคไธชๆๆ |
้ฃๆนๆincludeๅข |
What about changing it to include? |
ไฟฎๆน return uniqBy(list, (item) => item.identifier.split('/').pop()); ๆฅๆพ็จ includes()๏ผ const name = id.split('/').pop();
let model = list.find((item) => item.identifier.includes(name)); ไพๅฆ๏ผ [
{ identifier: '@cf/qwen/qwen1.5-14-b-chat-awq' },
{ identifier: 'qwen1.5-14-b-chat-awq' }
] ๅป้ๅ๏ผ [
{ identifier: '@cf/qwen/qwen1.5-14-b-chat-awq' },
] ๆฅๆพ็ปๆ๏ผ
|
How about modifying return uniqBy(list, (item) => item.identifier.split('/').pop()); Find using includes(): const name = id.split('/').pop();
let model = list.find((item) => item.identifier.includes(name)); For example: [
{ identifier: '@cf/qwen/qwen1.5-14-b-chat-awq' },
{ identifier: 'qwen1.5-14-b-chat-awq' }
] After deduplication: [
{ identifier: '@cf/qwen/qwen1.5-14-b-chat-awq' },
] Find results:
|
๐ป ๅๆด็ฑปๅ | Change Type
๐ ๅๆด่ฏดๆ | Description of Change
ๆจกๅๅ่กจๅป้ๆถๆฏไปฅ
/
ๅ็ๅ็งฐไฝไธบๅฏไธ้ฎ็๏ผWhen deduplicating model lists, the name after the
/
is used as the unique key:ไปฅ 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 isQwen/Qwen2-7B-Instruct
. In this case, it is not possible to find detailed information about the Gitee AI'sQwen2-7B-Instruct
model by determining thatitem.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
After:
The total number of models is 4 +10