constants
最后更新
modelconverter.utils.constantsmodelconverter 共享的知名目录和注册表。同一段代码运行两次:在主机上,它启动每个后端的 Docker 镜像;在该镜像内部,实际进行转换。两者看到的文件系统不同——容器将缓存绑定挂载到 /app/shared_with_container 并将其结果写入 /app/output,而在主机上则使用缓存目录和本地 ./output。下面的常量在导入时一次性确定了这种选择,因此包的其余部分可以直接引用它们。函数
get_cache_dir
Python
1def get_cache_dir() -> Path:XDG_CACHE_HOME,默认为 ~/.cache/modelconverter。in_docker
Python
1def in_docker() -> bool: