Skip to content

Commit b0c76e8

Browse files
Copilotrajbos
andcommitted
Normalize model names and remove API calls
Co-authored-by: rajbos <6085745+rajbos@users.noreply.github.com>
1 parent 933167f commit b0c76e8

2 files changed

Lines changed: 8 additions & 32 deletions

File tree

.github/scripts/scrape-models.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,10 @@ const fs = require('fs');
8282
console.error(`Table ${tableIndex}, Row ${rowIndex}: "${text}"`);
8383
8484
if (text && text.length > 0) {
85-
modelNames.push(text);
85+
// Normalize model name: lowercase and replace spaces with dashes
86+
const normalizedName = text.toLowerCase().replace(/\s+/g, '-');
87+
console.error(` Normalized: "${normalizedName}"`);
88+
modelNames.push(normalizedName);
8689
}
8790
} else {
8891
// Fallback to first td if no row header exists
@@ -92,7 +95,10 @@ const fs = require('fs');
9295
console.error(`Table ${tableIndex}, Row ${rowIndex} (fallback): "${text}"`);
9396
9497
if (text && text.length > 0) {
95-
modelNames.push(text);
98+
// Normalize model name: lowercase and replace spaces with dashes
99+
const normalizedName = text.toLowerCase().replace(/\s+/g, '-');
100+
console.error(` Normalized: "${normalizedName}"`);
101+
modelNames.push(normalizedName);
96102
}
97103
}
98104
}

.github/workflows/check-models.yml

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -39,36 +39,6 @@ jobs:
3939
page-content.html
4040
scraper.log
4141
42-
- name: List available models from GitHub Models API
43-
id: list_models
44-
env:
45-
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
46-
run: |
47-
# Get list of available models from GitHub Models API
48-
MODELS_CATALOG=$(curl -L -s \
49-
-H "Accept: application/vnd.github+json" \
50-
-H "Authorization: Bearer $GITHUB_TOKEN" \
51-
-H "X-GitHub-Api-Version: 2022-11-28" \
52-
https://models.github.ai/catalog/models)
53-
54-
# Save the API response for debugging
55-
echo "$MODELS_CATALOG" > api-models.json
56-
echo "Saved API response to api-models.json"
57-
58-
# Display the response in logs
59-
echo "=== GitHub Models API Response ==="
60-
echo "$MODELS_CATALOG" | jq .
61-
62-
echo ""
63-
echo "=== Available model IDs from API ==="
64-
echo "$MODELS_CATALOG" | jq -r '.[].id'
65-
66-
- name: Upload API response as artifact
67-
uses: actions/upload-artifact@v4
68-
with:
69-
name: api-response
70-
path: api-models.json
71-
7242
- name: Extract models from scraped data
7343
id: fetch_models
7444
run: |

0 commit comments

Comments
 (0)