mirror of
https://github.com/coalaura/whiskr.git
synced 2025-09-08 17:06:42 +00:00
clean model names
This commit is contained in:
13
models.go
13
models.go
@@ -1,6 +1,9 @@
|
||||
package main
|
||||
|
||||
import "context"
|
||||
import (
|
||||
"context"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Model struct {
|
||||
ID string `json:"id"`
|
||||
@@ -22,9 +25,15 @@ func LoadModels() ([]*Model, error) {
|
||||
models := make([]*Model, len(list))
|
||||
|
||||
for index, model := range list {
|
||||
name := model.Name
|
||||
|
||||
if index := strings.Index(name, ": "); index != -1 {
|
||||
name = name[index+2:]
|
||||
}
|
||||
|
||||
m := &Model{
|
||||
ID: model.ID,
|
||||
Name: model.Name,
|
||||
Name: name,
|
||||
Description: model.Description,
|
||||
SupportedParameters: model.SupportedParameters,
|
||||
}
|
||||
|
Reference in New Issue
Block a user