add uv use examples

This commit is contained in:
2025-12-01 17:26:55 +08:00
parent 678bd2b3f2
commit 0488a53f71
4 changed files with 113278 additions and 2 deletions

3
.gitignore vendored
View File

@@ -4,4 +4,5 @@ __pycache__/
*.pyc# pixi environments
.pixi/*
!.pixi/config.toml
*.egg-info/
*.egg-info/
*.zip

View File

@@ -382,4 +382,36 @@ uv run embedding-atlas data/drugbank_split_merge.csv --text smiles
如需调整默认镜像或端口,可在 `docker/docker-compose.yml` 中覆盖 `EMBEDDING_*` 环境变量,或在部署时通过 `.env` 文件注入。
> 注意:由于 orchestrator 运行在容器内并通过 DinD 调度新容器,如需在宿主机直接访问 `embedding-atlas` 的 Web UI需要确保相应端口从 `docker_engine_1` 转发到宿主,可按需求使用 `podman port` 或额外的反向代理。
> 注意:由于 orchestrator 运行在容器内并通过 DinD 调度新容器,如需在宿主机直接访问 `embedding-atlas` 的 Web UI需要确保相应端口从 `docker_engine_1` 转发到宿主,可按需求使用 `podman port` 或额外的反向代理。
## 使用 uv 同步依赖并导出 ring1220 ginhib≥30 的可视化应用
- **同步依赖**
```bash
uv sync
```
- **导出独立网页 ZIP**(基于已合并的数据 `data/ring12-20_fragments_filtered_predicted_ginhib_ge30_merged.csv`
```bash
uv run embedding-atlas data/ring12-20_fragments_filtered_predicted_ginhib_ge30_merged.csv \
--text cleaned_smiles \
--model all-MiniLM-L6-v2 \
--export-application data/ring12-20_ginhib_ge30_visualization.zip
```
- **解压并本地预览 index.html**
```bash
unzip -o data/ring12-20_ginhib_ge30_visualization.zip -d data/ring12-20_ginhib_ge30_visualization
```
预览方式:
- **VS Code Live Server 插件**:在解压目录中右键 `index.html` → “Open with Live Server”
- **内置 HTTP 服务**(可选):
```bash
python -m http.server 8000 --directory data/ring12-20_ginhib_ge30_visualization
# 浏览器打开 http://localhost:8000/index.html
```
网络提示:首次运行若需下载模型,可设置镜像以提升稳定性:
```bash
export HF_ENDPOINT=https://hf-mirror.com

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff