Follow these exact steps to push the Adversa environment to Hugging Face Spaces:
- Go to Hugging Face Spaces (make sure you are logged in).
- Click the "Create new Space" button in the top right.
- Fill out the form:
- Space name:
Adversa - License:
MIT - Select the Space SDK: Choose Docker.
- Docker Template: Choose Blank.
- Space Hardware: Free tier (CPU basic) is fine for the environment.
- Space name:
- Click "Create Space".
You have two options to get your code into the Space. Option A (Terminal) is highly recommended.
Open your terminal and run these exact commands (replace dorare22 with your actual Hugging Face username if it's different):
# Ensure you are in the project directory
cd /Users/rajesh/Desktop/Adversa
# Add the Hugging Face space as a remote repository
# Note: You will need your Hugging Face Access Token if prompted for a password.
# Get one at: https://huggingface.co/settings/tokens (needs 'write' role)
git remote add hf https://huggingface.co/spaces/dorare22/Adversa
# Push your code to Hugging Face
git push -u hf master:main(Note: We push your local master branch to the HF remote's main branch).
If the terminal push gives you Git credential headaches:
- Go to your newly created Space on the web.
- Click the "Files" tab.
- Click "Add file" -> "Upload files".
- Drag and drop ALL the files from
/Users/rajesh/Desktop/Adversa(including theserverandfrontendfolders,Dockerfile,run.sh, etc.). - Add a commit message and click "Commit changes".
- Once the code is pushed, go to the "App" tab on your Hugging Face Space.
- You will see a "Building" status log. The
Dockerfilewill install the requirements and then executerun.sh. - Wait about 1-2 minutes.
- When it says "Running", you should immediately see the beautiful navy/gold Gradio dashboard!
- Test the API: The backend is also running. You can test it by going to
https://dorare22-adversa.hf.space/healthin your browser. (It should return a JSON response).