Spaces:
Sleeping
Sleeping
Deploying to Hugging Face Spaces (Option A)
Hugging Face Spaces is the best free option for FocusFlow because it supports Docker, allowing us to compile the C++ module in the cloud.
Step 1: Create the Space
- Go to Hugging Face Spaces.
- Click "Create new Space".
- Name your space (e.g.,
FocusFlow). - Select Docker as the SDK.
- Choose "Blank" template.
- Set visibility to Public or Private.
- Click Create Space.
Step 2: Push your code
Since your code is already on GitHub, you can either:
Method A: Connect GitHub (Easiest)
- On your new Space page, go to the Settings tab (top right).
- Scroll down to the "Connected Repository" or "Github Repository" section.
- If you don't see your repo, click "Connect your GitHub" to authorize Hugging Face.
- Select your
kush-rc/FocusFlowrepository from the list. - Hugging Face will automatically build and deploy whenever you push to GitHub.
If you still can't see the "Connected Repository" section, it might be because the Space was created as a "Standard" Space. Make sure you selected Docker as the SDK during creation.
Method B: Manually Push via Git
- Get the Git URL of your Space (ends in
.git). - Add it as a new remote:
git remote add hf https://huggingface.co/spaces/YOUR_USERNAME/FocusFlow - Push to Hugging Face:
git push -f hf main
Step 3: Monitoring the Build
- Once pushed, go to the "Logs" tab in your Space.
- You will see the Docker image building and the C++ module compiling.
- Once finished, the Status will change to "Running".
Important Notes
- Port: Hugging Face requires the app to listen on port
7860. TheDockerfileandmain.pyare already configured for this. - Webcam: Ensure your site is accessed via
https(Hugging Face provides this automatically) so the browser allows camera access.