DaCrow13 commited on
Commit
a894f75
·
1 Parent(s): c2c8d10

docs: add Hugging Face Spaces deployment instructions to README.

Browse files
Files changed (1) hide show
  1. README.md +41 -0
README.md CHANGED
@@ -478,6 +478,47 @@ docker-compose down
478
  ```
479
 
480
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
481
  ## Demo UI (Streamlit)
482
 
483
  The Streamlit GUI provides an interactive web interface for the skill classification API.
 
478
  ```
479
 
480
 
481
+ --------
482
+
483
+ ## Hugging Face Spaces Deployment
484
+
485
+ This project is configured to run on [Hugging Face Spaces](https://huggingface.co/spaces) using Docker.
486
+
487
+ ### 1. Setup Space
488
+ 1. Create a new Space on Hugging Face.
489
+ 2. Select **Docker** as the SDK.
490
+ 3. Choose the **Blank** template or upload your code.
491
+
492
+ ### 2. Configure Secrets
493
+ To enable the application to pull models from DagsHub via DVC, you must configure the following **Variables and Secrets** in your Space settings:
494
+
495
+ | Name | Type | Description |
496
+ |------|------|-------------|
497
+ | `DAGSHUB_USERNAME` | Secret | Your DagsHub username. |
498
+ | `DAGSHUB_TOKEN` | Secret | Your DagsHub access token (Settings -> Tokens). |
499
+
500
+ > [!IMPORTANT]
501
+ > These secrets are injected into the container at runtime. The `scripts/start_space.sh` script uses them to authenticate DVC and pull the required model files (`.pkl`) before starting the API and GUI.
502
+
503
+ ### 3. Automated Startup
504
+ The deployment follows this automated flow:
505
+ 1. **Dockerfile**: Builds the environment, installs dependencies, and sets up Nginx.
506
+ 2. **scripts/start_space.sh**:
507
+ - Configures DVC with your secrets.
508
+ - Pulls models from the DagsHub remote.
509
+ - Starts the **FastAPI** backend (port 8000).
510
+ - Starts the **Streamlit** frontend (port 8501).
511
+ - Starts **Nginx** (port 7860) as a reverse proxy to route traffic.
512
+
513
+ ### 4. Direct Access
514
+ Once deployed, your Space will be available at:
515
+ `https://huggingface.co/spaces/se4ai2526-uniba/Hopcroft`
516
+
517
+ The API documentation will be accessible at:
518
+ `https://huggingface.co/spaces/se4ai2526-uniba/Hopcroft/docs`
519
+
520
+ --------
521
+
522
  ## Demo UI (Streamlit)
523
 
524
  The Streamlit GUI provides an interactive web interface for the skill classification API.