Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions .github/workflows/publish-model-card.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,13 @@ jobs:
echo "FILE: ${{ inputs.FILE }}"
echo "REPO: ${{ inputs.REPO }}"

- name: Build model-cards-cli
run: |
echo "Building model-cards-cli..."
cd tools/model-cards-cli
make build

- name: Upload model card overview
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USER }}
DOCKERHUB_OAT: ${{ secrets.DOCKER_OAT }}
run: |
echo "Uploading model card overview..."
make -C tools/model-cards-cli upload-overview \
make upload-overview \
FILE="${{ inputs.FILE }}" \
REPO="${{ inputs.REPO }}" \
USERNAME="$DOCKERHUB_USERNAME" \
Expand Down
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.PHONY: upload-overview

# Define variables for upload-overview command
FILE ?=
REPO ?=
USERNAME ?=
TOKEN ?=

upload-overview:
@if [ -z "$(FILE)" ]; then \
echo "Error: FILE parameter is required."; \
echo "Usage: make upload-overview FILE=<overview-file> REPO=<namespace/repository> USERNAME=<username> TOKEN=<token>"; \
exit 1; \
fi
@if [ -z "$(REPO)" ]; then \
echo "Error: REPO parameter is required."; \
echo "Usage: make upload-overview FILE=<overview-file> REPO=<namespace/repository> USERNAME=<username> TOKEN=<token>"; \
exit 1; \
fi
@if [ -z "$(USERNAME)" ]; then \
echo "Error: USERNAME parameter is required."; \
echo "Usage: make upload-overview FILE=<overview-file> REPO=<namespace/repository> USERNAME=<username> TOKEN=<token>"; \
exit 1; \
fi
@if [ -z "$(TOKEN)" ]; then \
echo "Error: TOKEN parameter is required."; \
echo "Usage: make upload-overview FILE=<overview-file> REPO=<namespace/repository> USERNAME=<username> TOKEN=<token>"; \
exit 1; \
fi
@echo "Building model-cards-cli..."
@$(MAKE) -C tools/model-cards-cli build
@echo "Uploading overview from $(FILE) to $(REPO)..."
@tools/model-cards-cli/bin/model-cards-cli upload-overview --file="$(FILE)" --repository="$(REPO)" --username="$(USERNAME)" --token="$(TOKEN)"

help:
@echo "Available targets:"
@echo " upload-overview - Upload an overview to Docker Hub (Usage: make upload-overview FILE=<overview-file> REPO=<namespace/repository> USERNAME=<username> TOKEN=<token>)"
@echo " Example: make upload-overview FILE=ai/llama3.1.md REPO=ai/llama3 USERNAME=your_username TOKEN=your_pat_here"
@echo " help - Show this help message"
Loading