-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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: Optimized MaxToken Slider #2258
Conversation
@sxjeru is attempting to deploy a commit to the LobeHub Team on Vercel. A member of the Team first needs to authorize it. |
👍 @sxjeru Thank you for raising your pull request and contributing to our Community |
256k 不太合理,目前主流的都是200k |
256k is not reasonable, the current mainstream is 200k |
256k 可能不够实用,但大体需要自定义的模型(lobechat 未适配的)基本达不到 200k。 为什么会自定义重复的模型,因为 oneapi 。 如果实在希望保留 200k,这边可以妥协。 |
256k may not be practical enough. If you enter a custom model ID, the tokens value can be automatically obtained from the lobechat model library, which will surely replace many 200k scenes. |
@sxjeru 我觉得这个倒是挺合理的,如果支持了这个,再把 200k 换成 256k 就没太大问题。 |
@sxjeru I think this is quite reasonable. If this is supported, then replacing 200k with 256k will not be a big problem. |
如果 0 是无限的话,我建议 token 的字符示意就应该也要用 无限大,而不是 Inf
这个倒可以
不需要减小。原因是开发 model 时, token 设定的最佳实践就是 2 次幂,一般常见的都是 4k、8k、16k、32k 等等。不太会有奇怪脑回路的7k 、15k 这种。如果真存在的话,再让用户在右边输入。 主动线上,我还是希望通过刻度保证用户配置操作的流畅性。 |
If 0 is infinite, I suggest that the character representation of token should also be infinite instead of Inf.
This is okay
No need to reduce. The reason is that the best practice for model token setting is the power of 2. The common ones are 4k, 8k, 16k, 32k, etc. It’s unlikely that 7k or 15k will have strange brain circuits. If it does exist, just let the right side enter it. In mainstream operations, scales are still used to ensure configuration fluency. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2258 +/- ##
=======================================
Coverage 92.96% 92.96%
=======================================
Files 301 301
Lines 17392 17393 +1
Branches 1255 1256 +1
=======================================
+ Hits 16169 16170 +1
Misses 1223 1223 ☔ View full report in Codecov by Sentry. |
这样可能导致其他语言的 tag 会很长,与 1K、1M 不太搭配。此外也有 tooltip 作为提示。
实际倒不是让用户来拖滑块,只是单纯输入数字时滑块可视化能精确些。 不会再考虑。 此外还存在 k 到底指 1024 还是 1000 的问题,按国外某些惯例:1 kilo = 1k = 1000, 目前处理方案 ff17c88 是 [128000, 1M) 采用 1000(小写 k),其他为 1024(大写 K),往后因时而变。 |
This may cause tags in other languages to be very long, which does not match 1K or 1M. In addition, there is also the question of whether k refers to 1024 or 1000. According to some foreign conventions: 1 kilo = 1k = 1000, The current solution for ff17c88 is [128000, 1M), which uses 1000 (lowercase k), and the others are 1024 (uppercase K), which may change over time. |
我的意思是用 ∞ 这个符号
你的考虑挺细致的,之前我也纠结过,但是后来想了下还是怎么简单怎么来了。其实100k以上就基本上不纠结 是1024单位还是 1000单位了。因为正常情况下都不会用到这个尺度 |
I mean using the symbol ∞ |
@sxjeru 需要 rebase 下 main 了 |
@sxjeru Need to rebase main |
src/app/(main)/settings/llm/components/ProviderModelList/MaxTokenSlider.tsx
Outdated
Show resolved
Hide resolved
src/app/(main)/settings/llm/components/ProviderModelList/MaxTokenSlider.tsx
Outdated
Show resolved
Hide resolved
src/app/(main)/settings/llm/components/ProviderModelList/MaxTokenSlider.tsx
Outdated
Show resolved
Hide resolved
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
是的…或者换成 icon 呢? https://lucide.dev/icons/infinity |
Yes...or change it to icon? https://lucide.dev/icons/infinity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, Thanks for your patience and great work!
❤️ Great PR @sxjeru ❤️ 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. |
### [Version 0.155.3](v0.155.2...v0.155.3) <sup>Released on **2024-05-08**</sup> #### 💄 Styles - **misc**: Optimized MaxToken Slider. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Styles * **misc**: Optimized MaxToken Slider, closes [#2258](#2258) ([dfb892b](dfb892b)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
🎉 This PR is included in version 0.155.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
### [Version 1.35.1](v1.35.0...v1.35.1) <sup>Released on **2024-05-08**</sup> #### 💄 Styles - **misc**: Optimized MaxToken Slider. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Styles * **misc**: Optimized MaxToken Slider, closes [lobehub#2258](https://github.com/bentwnghk/lobe-chat/issues/2258) ([dfb892b](dfb892b)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
* Update MaxTokenSlider * k -> K * i18n * Small screen adaptation * `next/image` Un-configured Host * ModelSelect.featureTag.tokens * 128k=128,000, 4K=4096, Kibi / kilo * Restore llm.ts * Inf -> ∞ * patch * const Kibi = 1024; * refactor marks * Update MaxTokenSlider.tsx * infinity icon
### [Version 0.155.3](lobehub/lobe-chat@v0.155.2...v0.155.3) <sup>Released on **2024-05-08**</sup> #### 💄 Styles - **misc**: Optimized MaxToken Slider. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Styles * **misc**: Optimized MaxToken Slider, closes [lobehub#2258](lobehub#2258) ([dfb892b](lobehub@dfb892b)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
* Update MaxTokenSlider * k -> K * i18n * Small screen adaptation * `next/image` Un-configured Host * ModelSelect.featureTag.tokens * 128k=128,000, 4K=4096, Kibi / kilo * Restore llm.ts * Inf -> ∞ * patch * const Kibi = 1024; * refactor marks * Update MaxTokenSlider.tsx * infinity icon
### [Version 0.155.3](lobehub/lobe-chat@v0.155.2...v0.155.3) <sup>Released on **2024-05-08**</sup> #### 💄 Styles - **misc**: Optimized MaxToken Slider. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### Styles * **misc**: Optimized MaxToken Slider, closes [lobehub#2258](lobehub#2258) ([dfb892b](lobehub@dfb892b)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
1k -> 0(无限制),200k -> 256k(避免重叠),k -> K。
限制最小值为 0,step 跨度从 1k 改为 2k 。
1k = 1000 -> 1k = 1024.
稍等尝试适配 i18n已适配。移动端测试刻度依旧重叠,尝试去掉单位。
📝 补充信息 | Additional Information
old:
new: