mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-04 10:13:53 +08:00
fix local model bug
This commit is contained in:
+208
-208
File diff suppressed because it is too large
Load Diff
@@ -512,8 +512,8 @@ func (i *imlLocalModel) OnInit() {
|
||||
})
|
||||
models, version := ai_provider_local.ModelsCanInstall()
|
||||
for _, model := range models {
|
||||
|
||||
if v, ok := oldModels[model.Id]; ok {
|
||||
delete(oldModels, model.Id)
|
||||
if v.Version == version {
|
||||
continue
|
||||
}
|
||||
@@ -541,7 +541,7 @@ func (i *imlLocalModel) OnInit() {
|
||||
return
|
||||
}
|
||||
}
|
||||
delete(oldModels, model.Id)
|
||||
|
||||
}
|
||||
for id := range oldModels {
|
||||
err = i.localModelPackageService.Delete(ctx, id)
|
||||
|
||||
@@ -694,7 +694,6 @@ func (i *imlProviderModule) UpdateProviderConfig(ctx context.Context, id string,
|
||||
}, newKey(defaultKey),
|
||||
}, true)
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ type imlLocalModelService struct {
|
||||
}
|
||||
|
||||
func (i *imlLocalModelService) UpdateProvider(ctx context.Context, provider string, ids ...string) error {
|
||||
_, err := i.store.UpdateWhere(ctx, map[string]interface{}{"provider": provider}, map[string]interface{}{"uuid": ids})
|
||||
_, err := i.store.UpdateField(ctx, "provider", provider, "uuid in (?)", ids)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -138,7 +138,8 @@ type LocalModelPackage struct {
|
||||
Name string `gorm:"type:varchar(100);not null;column:name;comment:名称"`
|
||||
Size string `gorm:"type:varchar(100);not null;column:size;comment:模型大小"`
|
||||
Hash string `gorm:"type:varchar(100);not null;column:hash;comment:模型hash"`
|
||||
Description string `gorm:"type:varchar(255);not null;column:description;comment:描述"`
|
||||
Description string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;not null;column:description;comment:描述"`
|
||||
Text string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;not null;column:text;comment:描述"`
|
||||
Version string `gorm:"type:varchar(100);not null;column:version;comment:版本"`
|
||||
IsPopular bool `gorm:"type:tinyint(1);not null;column:is_popular;comment:是否热门"`
|
||||
}
|
||||
@@ -187,4 +188,3 @@ func (i *ProviderModel) TableName() string {
|
||||
func (i *ProviderModel) IdValue() int64 {
|
||||
return i.Id
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user