Skip to content
CodexrefactorBackend7 files · +229 −58

Rework project embeddings to use Gradio app_file text and remove 100-project limit

Session from hackathon-advisor-codex-traces on Hugging Face by build-small-hackathon · Apache-2.0 · condensed by Coders Talk

29msession
0interventions
GOAL

Investigate why the hackathon advisor's embedding pipeline only indexed 100 projects and what text it embedded, then fix it to embed each Space's main Gradio app file and crawl all projects without a limit.

  1. Prompt · +0
    目前我們在製作 embedding 的時候是拿哪些資訊進去製作 embedding?然後為什麼只有挑選一百個 project?
  2. Agent did · +0m
    Traced the embedding pipeline through data.py, build_project_index.py, crawl_hf_spaces.py and llama_embedding.py to find what text goes into embeddings and where the 100-project limit comes from.
  3. Prompt · +4m
    要改兩件事:把主要的 app.py(從 readme frontmatter 取得)內容納入 embedding 分析,因為那反映使用者能做什麼;並移除 100 個 project 的 limit。
  4. Agent did · +5m
    Explored the HF Hub API for full space listing and file download, updated Project schema and crawler to pull README app_file and its text, raised embedding context window, dropped the crawl limit, and reran the crawler against build-small-hackathon.
  5. Fail · +13m
    Test suite and index build failed after the schema change: pytest errors and build_project_index.py exited with code 1 on the new app_file_text field and AST parsing.
  6. Agent did · +15m
    Fixed the AST node check and YAML scalar parsing in crawl_hf_spaces.py, reran build_project_index.py and generate_sample_trace.py, then got pytest to pass.
  7. Agent did · +22m
    Checked project data for leaked secrets, renamed field to app_file_embedding_text, stripped HTML tags/styling from app file text, rebuilt the index and sample trace, and confirmed all tests passing.
  8. Break · 34m away, not counted
  9. Prompt · +28m
    一百二十五個是目前上面所有的 project 了嗎?
  10. Agent did · +28m
    Queried the HF Hub author listing directly and diffed it against the snapshot to confirm the count and find the one project missing from data/projects.json.
  11. Outcome · +29m
    Committed and pushed the schema/crawler changes, rebuilt data/projects.json and data/project_index.json with all ~125 projects (no limit) including app-file embedding text, and synced the data to the Hugging Face Space.
VERDICT

Next time I'd open with both asks together — what goes into the embedding and why there's a 100-project cap — since the agent had to dig through the same files twice. The fix that actually mattered was pulling in the README app_file's own content for embeddings and dropping the limit outright; the AST/YAML parsing bugs that broke the tests afterward were just cleanup, not the real work.

I tried this · 0

Discussion · 0

How Builds work