Skip to content

Commit

Permalink
fix: model ls
Browse files Browse the repository at this point in the history
  • Loading branch information
dantegarden committed Jul 30, 2024
1 parent 627f1e7 commit 37750ab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cmd/ls_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ func ListModel(c *cli.Context) error {

modelRecords := modelResp.Data.Models

if len(modelRecords) < 1 {
fmt.Fprintln(os.Stdout, "No models found.")
return nil
}

w := tabwriter.NewWriter(os.Stdout, 0, 0, 1, ' ', tabwriter.Debug)
fmt.Fprintln(w, "Name\t Type\t Last Modified Time\t")
// Print data rows
Expand Down
4 changes: 4 additions & 0 deletions cmd/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ func checkType(args *config.Argument, required bool) error {
return cli.Exit("The following arguments are required: type", meta.LoadError)
}

if args.Type == "" {
return nil
}

modelType := meta.UploadFileType(args.Type)
if !lo.Contains[meta.UploadFileType](meta.ModelTypes, modelType) {
return cli.Exit(fmt.Sprintf("Unsupported type, only works for %s", meta.ModelTypesStr), meta.LoadError)
Expand Down
2 changes: 1 addition & 1 deletion meta/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const (
)

const (
DefaultDomain = "https://api.siliconflow.cn"
DefaultDomain = "https://bizyair-api.siliconflow.cn"
)

const (
Expand Down

0 comments on commit 37750ab

Please sign in to comment.