Skill 17 · Huggingface Paper Publisher
Subchapter 17.7
examples/example_usage.mdMarkdown8 KBView on GitHub
This document demonstrates common workflows for publishing research papers on Hugging Face Hub.
If you’ve already published a paper on arXiv and want to make it discoverable on Hugging Face:
# Check if paper exists
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"
# Index the paper
uv run scripts/paper_manager.py index --arxiv-id "2301.12345"
# Get paper information
uv run scripts/paper_manager.py info --arxiv-id "2301.12345"Expected output:
{
"exists": true,
"url": "https://huggingface.co/papers/2301.12345",
"arxiv_id": "2301.12345",
"arxiv_url": "https://arxiv.org/abs/2301.12345"
}After indexing a paper, link it to your model repository:
# Link single paper
uv run scripts/paper_manager.py link \
--repo-id "username/my-awesome-model" \
--repo-type "model" \
--arxiv-id "2301.12345"
# Link multiple papers
uv run scripts/paper_manager.py link \
--repo-id "username/my-awesome-model" \
--repo-type "model" \
--arxiv-ids "2301.12345,2302.67890"This will:
arxiv:2301.12345 tagsSame process for datasets:
uv run scripts/paper_manager.py link \
--repo-id "username/my-dataset" \
--repo-type "dataset" \
--arxiv-id "2301.12345" \
--citation "$(cat citation.bib)"Generate a research paper from template:
# Create with standard template
uv run scripts/paper_manager.py create \
--template "standard" \
--title "Efficient Fine-Tuning of Large Language Models" \
--authors "Jane Doe, John Smith" \
--abstract "We propose a novel approach to fine-tuning..." \
--output "paper.md"
# Create with modern template
uv run scripts/paper_manager.py create \
--template "modern" \
--title "Vision Transformers for Medical Imaging" \
--output "medical_vit_paper.md"
# Create ML experiment report
uv run scripts/paper_manager.py create \
--template "ml-report" \
--title "BERT Fine-tuning Experiment Results" \
--output "bert_experiment_report.md"Get formatted citations for papers:
# BibTeX format
uv run scripts/paper_manager.py citation \
--arxiv-id "2301.12345" \
--format "bibtex"Output:
@article{arxiv2301_12345,
title={Efficient Fine-Tuning of Large Language Models},
author={Doe, Jane and Smith, John},
journal={arXiv preprint arXiv:2301.12345},
year={2023}
}Full workflow from paper creation to publication:
# Step 1: Create research article
uv run scripts/paper_manager.py create \
--template "modern" \
--title "Novel Architecture for Multimodal Learning" \
--authors "Alice Chen, Bob Kumar" \
--output "multimodal_paper.md"
# Step 2: Edit the paper (use your favorite editor)
# vim multimodal_paper.md
# Step 3: Submit to arXiv (external process)
# Upload to arxiv.org, receive arXiv ID: 2312.99999
# Step 4: Index on Hugging Face
uv run scripts/paper_manager.py index --arxiv-id "2312.99999"
# Step 5: Link to your models/datasets
uv run scripts/paper_manager.py link \
--repo-id "alice/multimodal-model-v1" \
--repo-type "model" \
--arxiv-id "2312.99999"
uv run scripts/paper_manager.py link \
--repo-id "alice/multimodal-dataset" \
--repo-type "dataset" \
--arxiv-id "2312.99999"
# Step 6: Generate citation for README
uv run scripts/paper_manager.py citation \
--arxiv-id "2312.99999" \
--format "bibtex" > citation.bibLink multiple papers to multiple repositories:
#!/bin/bash
# List of papers
PAPERS=("2301.12345" "2302.67890" "2303.11111")
# List of models
MODELS=("username/model-a" "username/model-b" "username/model-c")
# Link each paper to each model
for paper in "${PAPERS[@]}"; do
for model in "${MODELS[@]}"; do
echo "Linking $paper to $model..."
uv run scripts/paper_manager.py link \
--repo-id "$model" \
--repo-type "model" \
--arxiv-id "$paper"
done
doneGet paper info and manually update model card:
# Get paper information
uv run scripts/paper_manager.py info \
--arxiv-id "2301.12345" \
--format "text" > paper_info.txt
# View the information
cat paper_info.txt
# Manually incorporate into your model card or use the link command# Search for papers (opens browser)
uv run scripts/paper_manager.py search \
--query "transformer attention mechanism"This skill complements tfrere’s research article template (opens in a new tab):
# 1. Use tfrere's Space to create a beautiful web-based paper
# Visit: https://huggingface.co/spaces/tfrere/research-article-template
# 2. Export your paper content to markdown
# 3. Submit to arXiv
# 4. Use this skill to index and link
uv run scripts/paper_manager.py index --arxiv-id "YOUR_ARXIV_ID"
uv run scripts/paper_manager.py link \
--repo-id "your-username/your-model" \
--arxiv-id "YOUR_ARXIV_ID"# Check if paper exists before linking
if uv run scripts/paper_manager.py check --arxiv-id "2301.12345" | grep -q '"exists": true'; then
echo "Paper exists, proceeding with link..."
uv run scripts/paper_manager.py link \
--repo-id "username/model" \
--arxiv-id "2301.12345"
else
echo "Paper doesn't exist, indexing first..."
uv run scripts/paper_manager.py index --arxiv-id "2301.12345"
uv run scripts/paper_manager.py link \
--repo-id "username/model" \
--arxiv-id "2301.12345"
fiAdd to your .github/workflows/update-paper.yml:
name: Update Paper Links
on:
push:
branches: [main]
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Link paper to model
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
uv run scripts/paper_manager.py link \
--repo-id "${{ github.repository_owner }}/model-name" \
--repo-type "model" \
--arxiv-id "2301.12345"# Visit the URL directly to trigger indexing
open "https://huggingface.co/papers/2301.12345"
# Wait a few seconds, then check again
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"# Verify your token has write access
echo $HF_TOKEN
# Set token if missing
export HF_TOKEN="your_token_here"
# Or use .env file
echo "HF_TOKEN=your_token_here" > .env# The script handles various formats:
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"
uv run scripts/paper_manager.py check --arxiv-id "arxiv:2301.12345"
uv run scripts/paper_manager.py check --arxiv-id "https://arxiv.org/abs/2301.12345"
# All are equivalent and will be normalized