Hugging Face Space - chunhualiao/public-docs GitHub Wiki

Here are the main steps Hugging Face Spaces follows to process the files in your repository and deploy your project online:

  1. Repository Cloning
    When you create or update a Space, Hugging Face clones your Git repository (from Hugging Face or GitHub) into a fresh environment.

  2. Environment Setup

    • If your repo contains a requirements.txt, environment.yml, or packages.txt, Hugging Face installs the listed Python and system dependencies.
    • For Node.js or other runtimes, it looks for files like package.json or custom setup scripts.
    • The environment is typically a Linux container with Python pre-installed.
  3. Entrypoint Detection

    • Hugging Face Spaces looks for a main file to run. For Gradio or Streamlit apps, it expects app.py (or main.py).
    • For static sites, it looks for index.html.
    • For custom setups, you can specify the entrypoint in the Space settings.
  4. App Launch

    • The platform runs your app using the detected entrypoint (e.g., python app.py for Gradio).
    • The app is started on a specific port (usually 7860 for Gradio), and the Space proxies web traffic to this port.
  5. Live Deployment

    • Once the app is running, Hugging Face exposes it at a public URL.
    • Any changes you push to the repo trigger an automatic redeploy: the process repeats from step 1.

Summary of the main steps:

  1. Clone repo → 2. Install dependencies → 3. Detect entrypoint → 4. Launch app → 5. Serve at public URL

If you want a more detailed breakdown of any step (e.g., how dependencies are resolved, how to customize the entrypoint, or how to debug deployment issues), let me know!