Skip to content

Commit d9bb55e

Browse files
committed
Fixed raw urls for compose.yaml
1 parent 0e90a0b commit d9bb55e

3 files changed

Lines changed: 25 additions & 16 deletions

File tree

generator/generate_docs.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
44
Usage:
55
python3 generator/generate_docs.py
6+
python3 generator/generate_docs.py --update
7+
python3 generator/generate_docs.py --update-after
68
79
"""
810

@@ -20,6 +22,10 @@
2022

2123

2224
if __name__ == "__main__":
25+
args = sys.argv[1:]
26+
if "--update" in args:
27+
distribute()
28+
sys.exit()
2329

2430
# For openad-toolkit repo
2531
oad_update_readme()
@@ -34,7 +40,6 @@
3440
# Other files
3541
generate_commands_csv()
3642

37-
args = sys.argv[1:]
38-
if "--update" in args:
43+
if "--update-after" in args:
3944
print("\n\n\n\n")
4045
distribute()

generator/methods/generate_model_docs.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# python3 docs/generate_model_docs.py
2-
31
import os
42
import re
53
import pandas as pd
@@ -76,6 +74,10 @@ def scrape_repos():
7674
results = []
7775
for _, row in df.iterrows():
7876
repo_url = row["Repository"]
77+
# Raw URL: https://github.com/acceleratedscience/<repo_name>/raw/main/<filename>
78+
# Forwards to: https://raw.githubusercontent.com/acceleratedscience/<repo_name>/main/<filename>
79+
# The first URL can't be downloaded using curl, so we need to use the second one
80+
repo_url_raw = repo_url.replace("github.com", "raw.githubusercontent.com")
7981
name = row["Name"]
8082
try:
8183
# Scrape the README.md file
@@ -95,13 +97,13 @@ def scrape_repos():
9597
description = parse_description(readme_text, repo_name)
9698

9799
# Check support for Docker (Dockerfile)
98-
dockerfile_url = f"{repo_url}/raw/main/Dockerfile"
100+
dockerfile_url = f"{repo_url_raw}/main/Dockerfile"
99101
dockerfile_exists = (
100102
requests.get(dockerfile_url, timeout=10).status_code == 200
101103
)
102104

103105
# Check support for Docker compose (compose.yaml)
104-
compose_yml_url = f"{repo_url}/raw/main/compose.yaml"
106+
compose_yml_url = f"{repo_url_raw}/main/compose.yaml"
105107
compose_exists = (
106108
requests.get(compose_yml_url, timeout=10).status_code == 200
107109
)
@@ -124,6 +126,7 @@ def scrape_repos():
124126
"title": title,
125127
"repo_name": repo_name,
126128
"url": repo_url,
129+
"compose_yml_url": compose_yml_url,
127130
"description": description,
128131
"support:docker": dockerfile_exists,
129132
"support:compose": compose_exists,
@@ -228,9 +231,10 @@ def generate_md(model_data):
228231
repo_name = model["repo_name"]
229232
service_name = repo_name.replace("openad-service-", "").replace("-", "_")
230233
url = model["url"]
234+
compose_yml_url = model["compose_yml_url"]
231235
btn_github = f"[:carbon-icn-github: {repo_name}]({url}){{ .md-button }}"
232236
btn_compose = (
233-
f"[compose.yml]({url}/raw/main/compose.yaml){{ .md-button .md-button--primary download='compose.yml' }}"
237+
f"[compose.yml]({compose_yml_url}){{ .md-button .md-button--primary download='compose.yml' }}"
234238
if model["support:compose"]
235239
else "--REMOVE-LINE--"
236240
)
@@ -250,7 +254,7 @@ def generate_md(model_data):
250254
docker_compose_instructions = (
251255
"Quick start with Docker Compose:\n"
252256
"```\n"
253-
f"curl -O {url}/raw/main/compose.yaml\n"
257+
f"curl -O {compose_yml_url}\n"
254258
"```\n"
255259
"```\n"
256260
f"docker compose create\n"

main/docs/model-service/available-models.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Go to [Deploying Models](deploying-models.md) for more detailed deployment optio
1919
<div markdown>
2020

2121
[:carbon-icn-github: openad-service-smi-ted](https://github.com/acceleratedscience/openad-service-smi-ted){ .md-button }
22-
[compose.yml](https://github.com/acceleratedscience/openad-service-smi-ted/raw/main/compose.yaml){ .md-button .md-button--primary download='compose.yml' }
22+
[compose.yml](https://raw.githubusercontent.com/acceleratedscience/openad-service-smi-ted/main/compose.yaml){ .md-button .md-button--primary download='compose.yml' }
2323
[Instructions](/docs/model-service/deploying-models/#deployment-via-container-composeyaml-recommended){ .md-button .md-button--tertiary }
2424

2525
This OpenAD service provides access to the **SMILES-based Transformer Encoder-Decoder** (SMILES-TED), which is an encoder-decoder model pre-trained on a curated dataset of 91 million SMILES samples sourced from PubChem, equivalent to 4 billion molecular tokens. SMI-TED supports various complex tasks, including quantum property prediction, with two main variants ( 289 M and 8 × 289 M ).
@@ -38,7 +38,7 @@ Support for:
3838

3939
Quick start with Docker Compose:
4040
```
41-
curl -O https://github.com/acceleratedscience/openad-service-smi-ted/raw/main/compose.yaml
41+
curl -O https://raw.githubusercontent.com/acceleratedscience/openad-service-smi-ted/main/compose.yaml
4242
```
4343
```
4444
docker compose create
@@ -60,7 +60,7 @@ catalog model service from remote 'http://127.0.0.1:8080' as smi_ted
6060
<div markdown>
6161

6262
[:carbon-icn-github: openad-service-bmfm-sm](https://github.com/acceleratedscience/openad-service-bmfm-sm){ .md-button }
63-
[compose.yml](https://github.com/acceleratedscience/openad-service-bmfm-sm/raw/main/compose.yaml){ .md-button .md-button--primary download='compose.yml' }
63+
[compose.yml](https://raw.githubusercontent.com/acceleratedscience/openad-service-bmfm-sm/main/compose.yaml){ .md-button .md-button--primary download='compose.yml' }
6464
[Instructions](/docs/model-service/deploying-models/#deployment-via-container-composeyaml-recommended){ .md-button .md-button--tertiary }
6565

6666
This OpenAD service provides access to the **Biomedmultiview** foundation model with checkpoints for the following properties:
@@ -84,7 +84,7 @@ Support for:
8484

8585
Quick start with Docker Compose:
8686
```
87-
curl -O https://github.com/acceleratedscience/openad-service-bmfm-sm/raw/main/compose.yaml
87+
curl -O https://raw.githubusercontent.com/acceleratedscience/openad-service-bmfm-sm/main/compose.yaml
8888
```
8989
```
9090
docker compose create
@@ -106,7 +106,7 @@ catalog model service from remote 'http://127.0.0.1:8080' as bmfm_sm
106106
<div markdown>
107107

108108
[:carbon-icn-github: openad-service-bmfm-pm](https://github.com/acceleratedscience/openad-service-bmfm-pm){ .md-button }
109-
[compose.yml](https://github.com/acceleratedscience/openad-service-bmfm-pm/raw/main/compose.yaml){ .md-button .md-button--primary download='compose.yml' }
109+
[compose.yml](https://raw.githubusercontent.com/acceleratedscience/openad-service-bmfm-pm/main/compose.yaml){ .md-button .md-button--primary download='compose.yml' }
110110
[Instructions](/docs/model-service/deploying-models/#deployment-via-container-composeyaml-recommended){ .md-button .md-button--tertiary }
111111

112112
This OpenAD service provides access to the **Biomedmultialignment** foundation model with checkpoints for the following properties:
@@ -126,7 +126,7 @@ Support for:
126126

127127
Quick start with Docker Compose:
128128
```
129-
curl -O https://github.com/acceleratedscience/openad-service-bmfm-pm/raw/main/compose.yaml
129+
curl -O https://raw.githubusercontent.com/acceleratedscience/openad-service-bmfm-pm/main/compose.yaml
130130
```
131131
```
132132
docker compose create
@@ -148,7 +148,7 @@ catalog model service from remote 'http://127.0.0.1:8080' as bmfm_pm
148148
<div markdown>
149149

150150
[:carbon-icn-github: openad-service-reinvent4](https://github.com/acceleratedscience/openad-service-reinvent4){ .md-button }
151-
[compose.yml](https://github.com/acceleratedscience/openad-service-reinvent4/raw/main/compose.yaml){ .md-button .md-button--primary download='compose.yml' }
151+
[compose.yml](https://raw.githubusercontent.com/acceleratedscience/openad-service-reinvent4/main/compose.yaml){ .md-button .md-button--primary download='compose.yml' }
152152
[Instructions](/docs/model-service/deploying-models/#deployment-via-container-composeyaml-recommended){ .md-button .md-button--tertiary }
153153

154154
This OpenAD service provides access to the **REINVENT 4** molecular design tool, which is used for de novo design, scaffold hopping, R-group replacement, linker design, molecule optimization, and other small molecule design tasks. REINVENT uses a Reinforcement Learning (RL) algorithm to generate optimized molecules compliant with a user-defined property profile defined as a multi-component score. Transfer Learning (TL) can be used to create or pre-train a model that generates molecules closer to a set of input molecules.
@@ -166,7 +166,7 @@ Support for:
166166

167167
Quick start with Docker Compose:
168168
```
169-
curl -O https://github.com/acceleratedscience/openad-service-reinvent4/raw/main/compose.yaml
169+
curl -O https://raw.githubusercontent.com/acceleratedscience/openad-service-reinvent4/main/compose.yaml
170170
```
171171
```
172172
docker compose create

0 commit comments

Comments
 (0)