Skip to content

Conversation

@Dayuxiaoshui
Copy link
Contributor

PR Category

Feature Enhancement

Description

工作流程

实现从 HuggingFace ModelID 到 GraphNet Sample 的自动化提取:

  1. Fetch: 从 HuggingFace Hub 下载模型
  2. Analyze: 解析 config.json 提取元数据(输入形状、vocab_size、embedding_size 等)
  3. CodeGen: 自动生成 run_model.py 提取脚本
  4. Extract: 执行脚本提取计算图
  5. Deduplicate: 基于 graph_hash.txt 检测重复样本
  6. Verify: 验证样本完整性
  7. Archive: 保存 run_model.py 到样本目录

核心特性

  • 模块化设计,各组件职责清晰
  • 智能输入生成:根据模型类型和 embedding_size 动态调整 vocab_size,避免 CUDA 错误
  • 多策略输出目录查找,支持 GraphNet hash 命名
  • 完善的错误处理和日志记录

目前的不足

  1. 主要支持 NLP 模型,Vision 模型支持需完善
  2. 输入形状推断基于启发式方法,复杂模型可能不够准确
  3. 去重仅检查本地目录,未实现知识库级别去重
  4. 串行执行,缺少并发支持

成功率测试脚本

提供批量测试脚本评估 Agent 成功率:

  • test_batch_success_rate.py: 核心模块,支持从 HuggingFace Hub 或文件获取模型列表,实时显示统计,生成 JSON 报告
  • run_500_models_test.py: 便捷脚本,支持混合任务类型

使用示例:

测试 100 个模型

python -m graph_net.agent.tests.run_500_models_test --count 100 --task text-classification

@paddle-bot
Copy link

paddle-bot bot commented Jan 27, 2026

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant