Skip to content

Commit b95b0b7

Browse files
committed
chore(ci): fix gallery agent
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent 26f1b94 commit b95b0b7

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/gallery-agent/agent.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ func getRealReadme(ctx context.Context, repository string) (string, error) {
133133
result, err := cogito.ExecuteTools(llm, fragment,
134134
cogito.WithIterations(3),
135135
cogito.WithMaxAttempts(3),
136+
cogito.DisableSinkState,
136137
cogito.WithTools(&HFReadmeTool{client: hfapi.NewClient()}))
137138
if err != nil {
138139
return "", err

.github/gallery-agent/gallery.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,20 @@ func generateYAMLEntry(model ProcessedModel, quantization string) string {
7979
description = cleanTextContent(description)
8080
formattedDescription := formatTextContent(description)
8181

82-
configFile := formatTextContent(modelConfig.ConfigFile)
82+
// Strip name and description from config file since they are
83+
// already present at the gallery entry level and should not
84+
// appear under overrides.
85+
configFileContent := modelConfig.ConfigFile
86+
var cfgMap map[string]any
87+
if err := yaml.Unmarshal([]byte(configFileContent), &cfgMap); err == nil {
88+
delete(cfgMap, "name")
89+
delete(cfgMap, "description")
90+
if cleaned, err := yaml.Marshal(cfgMap); err == nil {
91+
configFileContent = string(cleaned)
92+
}
93+
}
94+
95+
configFile := formatTextContent(configFileContent)
8396

8497
filesYAML, _ := yaml.Marshal(modelConfig.Files)
8598

.github/gallery-agent/testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func runSyntheticMode() error {
1717
fmt.Printf("Generating %d synthetic models for testing...\n", numModels)
1818

1919
var models []ProcessedModel
20-
for i := range numModels {
20+
for range numModels {
2121
model := generator.GenerateProcessedModel()
2222
models = append(models, model)
2323
fmt.Printf("Generated synthetic model: %s\n", model.ModelID)

.github/workflows/gallery-agent.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- name: Run gallery agent
5656
env:
5757
#OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }}
58-
OPENAI_MODE: Qwen3.5-2B-GGUF
58+
OPENAI_MODEL: Qwen3.5-2B-GGUF
5959
OPENAI_BASE_URL: "http://localhost:8080"
6060
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
6161
#OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}

0 commit comments

Comments
 (0)