dataset支持dataset_id软连接
This commit is contained in:
parent
94471c90d8
commit
9f669e1b6d
@ -334,6 +334,23 @@ def create_robot_project(dataset_ids: List[str], bot_id: str, force_rebuild: boo
|
||||
scripts_dir.mkdir(parents=True, exist_ok=True)
|
||||
download_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# 清空 dataset_dir 下的所有软链接
|
||||
for item in dataset_dir.iterdir():
|
||||
if item.is_symlink():
|
||||
item.unlink()
|
||||
logger.info(f"Removed from dataset_dir: {item}")
|
||||
|
||||
# 为 dataset_ids 创建软链接
|
||||
docs_datasets_dir = project_path / "docs" / "datasets"
|
||||
for dataset_id in dataset_ids:
|
||||
source = docs_datasets_dir / dataset_id
|
||||
target = dataset_dir / dataset_id
|
||||
if source.exists():
|
||||
os.symlink(source.resolve(), target)
|
||||
logger.info(f"Created symlink: {target} -> {source.resolve()}")
|
||||
else:
|
||||
logger.warning(f"Dataset source not found, skipping symlink: {source}")
|
||||
|
||||
# 处理 skills(每次都更新)
|
||||
if skills:
|
||||
_extract_skills_to_robot(bot_id, skills, project_path)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user