Files
YG_FT/backend/app/modules
caoxiaozhu 2f48934e66 fix(data_process): 修复 tiktoken 加载器的变量作用域错误
函数内部的 import tiktoken.core 会把 tiktoken 变成局部变量,导致
tiktoken.get_encoding 在联网下载前就抛 UnboundLocalError,被 except
吞掉后联网与本地缓存两条路径全部失效。移除该内部 import(模块顶部
已引入 tiktoken),切分测试全部通过,编码器成功下载并缓存到
~/.cache/tiktoken,此后离线环境也可正常加载。
2026-08-18 15:49:00 +08:00
..
2026-08-03 09:34:08 +08:00
2026-08-03 09:34:08 +08:00
2026-08-17 09:15:36 +08:00

Backend Module Convention

每个业务模块建议保持一致结构:

module_name/
  __init__.py
  router.py       # FastAPI router
  schemas.py      # Pydantic request/response models
  service.py      # Business orchestration
  repository.py   # Database access
  permissions.py  # Optional resource permission checks

模块边界以 docs/system-development-plan.md 的页面模块开发工作包为准。