From b95b0b72ff3c8a79eeb956fef036684c549fb8c5 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 2 Apr 2026 17:17:15 +0000 Subject: [PATCH] chore(ci): fix gallery agent Signed-off-by: Ettore Di Giacinto --- .github/gallery-agent/agent.go | 1 + .github/gallery-agent/gallery.go | 15 ++++++++++++++- .github/gallery-agent/testing.go | 2 +- .github/workflows/gallery-agent.yaml | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/gallery-agent/agent.go b/.github/gallery-agent/agent.go index 4de05b51e..1d3a8d99d 100644 --- a/.github/gallery-agent/agent.go +++ b/.github/gallery-agent/agent.go @@ -133,6 +133,7 @@ func getRealReadme(ctx context.Context, repository string) (string, error) { result, err := cogito.ExecuteTools(llm, fragment, cogito.WithIterations(3), cogito.WithMaxAttempts(3), + cogito.DisableSinkState, cogito.WithTools(&HFReadmeTool{client: hfapi.NewClient()})) if err != nil { return "", err diff --git a/.github/gallery-agent/gallery.go b/.github/gallery-agent/gallery.go index 749001a79..f288aee10 100644 --- a/.github/gallery-agent/gallery.go +++ b/.github/gallery-agent/gallery.go @@ -79,7 +79,20 @@ func generateYAMLEntry(model ProcessedModel, quantization string) string { description = cleanTextContent(description) formattedDescription := formatTextContent(description) - configFile := formatTextContent(modelConfig.ConfigFile) + // Strip name and description from config file since they are + // already present at the gallery entry level and should not + // appear under overrides. + configFileContent := modelConfig.ConfigFile + var cfgMap map[string]any + if err := yaml.Unmarshal([]byte(configFileContent), &cfgMap); err == nil { + delete(cfgMap, "name") + delete(cfgMap, "description") + if cleaned, err := yaml.Marshal(cfgMap); err == nil { + configFileContent = string(cleaned) + } + } + + configFile := formatTextContent(configFileContent) filesYAML, _ := yaml.Marshal(modelConfig.Files) diff --git a/.github/gallery-agent/testing.go b/.github/gallery-agent/testing.go index 10170af01..289f74f3f 100644 --- a/.github/gallery-agent/testing.go +++ b/.github/gallery-agent/testing.go @@ -17,7 +17,7 @@ func runSyntheticMode() error { fmt.Printf("Generating %d synthetic models for testing...\n", numModels) var models []ProcessedModel - for i := range numModels { + for range numModels { model := generator.GenerateProcessedModel() models = append(models, model) fmt.Printf("Generated synthetic model: %s\n", model.ModelID) diff --git a/.github/workflows/gallery-agent.yaml b/.github/workflows/gallery-agent.yaml index 8c0c2a6ec..3cb24c09a 100644 --- a/.github/workflows/gallery-agent.yaml +++ b/.github/workflows/gallery-agent.yaml @@ -55,7 +55,7 @@ jobs: - name: Run gallery agent env: #OPENAI_MODEL: ${{ secrets.OPENAI_MODEL }} - OPENAI_MODE: Qwen3.5-2B-GGUF + OPENAI_MODEL: Qwen3.5-2B-GGUF OPENAI_BASE_URL: "http://localhost:8080" OPENAI_KEY: ${{ secrets.OPENAI_KEY }} #OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}