Overseas access: www.kdjingpai.com
Bookmark Us
Current Position:fig. beginning " AI Answers

怎样避免在准备LLM训练数据时误处理Git仓库中的非相关文件?

2025-09-10 1.8 K

Background to the issue

Git仓库常包含二进制/日志/临时文件等无用数据,手动筛选费时且易遗漏。

多层过滤方案

  • 基础过滤:自动应用.gitignore规则(如node_modules/)
  • 扩展过滤:通过文件类型检测排除二进制/媒体文件
  • 大小过滤:默认跳过过大文件(可调整阈值)
  • 历史加权:根据Git提交频率智能评估文件重要性

concrete operation

  1. 确保仓库有完整.gitignore文件
  2. 运行基础检查:yek –dry-run查看将被处理的文件列表
  3. 添加自定义规则:
    – 在yek.toml中配置额外忽略模式
    – 使用–include/–exclude参数临时调整
  4. 验证效果:对比处理前后的文件统计信息

typical case

处理前端项目时可自动忽略:
– build/ dist/等构建目录
– *.png等资源文件
– package-lock.json等依赖文件
专注于核心业务代码文件。

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish