[feat][meta] Modelscope download and access#106
Closed
sjjy123 wants to merge 0 commit into
Closed
Conversation
zhaoxianhua
reviewed
Jan 6, 2026
| } | ||
|
|
||
| // NewModelscopeHandler 创建模型代理处理器实例 | ||
| func NewModelscopeHandler(ModelscopeService *service.ModelscopeService) *ModelscopeHandler { |
zhaoxianhua
reviewed
Jan 6, 2026
| chunkSize: 8388608 # 8MB分块,16*1024*1024的数值结果 | ||
| maxRetry: 5 # 超时重试次数 | ||
| retryDelay: 3 # 重试间隔,单位秒(S)(原配置为5*time.Second,YAML中简化为数值+注释) | ||
| minFileSize: 1 # 最小缓存文件大小,单位字节(B) No newline at end of file |
zhaoxianhua
reviewed
Jan 6, 2026
| webhook: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=73662ac1-1055-48a7-8c89-37964b5f4fdc111 # 企业微信机器人Webhook地址 | ||
|
|
||
| modelscope: | ||
| modelCacheRoot: ./repos/modelscope/models # 模型缓存根目录 |
zhaoxianhua
reviewed
Jan 6, 2026
| func (h *ModelscopeHandler) ModelInfoHandler(c echo.Context) error { | ||
| parts := strings.Split(strings.Trim(c.Request().URL.Path, "/"), "/") | ||
|
|
||
| org, repo, repoType := parts[3], parts[4], parts[2] |
zhaoxianhua
reviewed
Jan 6, 2026
| } | ||
|
|
||
| // createHTTPClient 创建宽松超时的HTTP客户端 | ||
| func CreateHTTPClient() *http.Client { |
zhaoxianhua
reviewed
Jan 6, 2026
| readSize = int64(len(buf)) | ||
| } | ||
|
|
||
| n, err := cacheFile.Read(buf[:readSize]) |
Contributor
Author
There was a problem hiding this comment.
经过测试同时读取8个本地10GB缓存文件数据,占用内存只有95.7MB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modelscope download and access