WorldDisasterLM-8B / .github /workflows /publish-huggingface.yml
drdeveloper88's picture
Upload WorldDisasterLM-8B source code: FastAPI backend, training pipeline, 11-language support
495526b
Raw
History Blame Contribute Delete
1.19 kB
name: Publish To Hugging Face
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install tooling
run: |
python -m pip install --upgrade pip
pip install huggingface_hub
- name: Push model artifacts
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
python - << 'PY'
import os
from huggingface_hub import HfApi
token = os.environ.get("HF_TOKEN")
if not token:
raise SystemExit("HF_TOKEN secret is required")
repo_id = "worlddisasterlm/worlddisasterlm"
api = HfApi(token=token)
api.create_repo(repo_id=repo_id, repo_type="model", exist_ok=True)
for file_name in ["README.md", "MODEL_CARD.md"]:
api.upload_file(
path_or_fileobj=file_name,
path_in_repo=file_name,
repo_id=repo_id,
repo_type="model",
)
print(f"Published metadata to {repo_id}")
PY