CoolFace
Apppublic

aroniscunt/Browser_Web_UI_Automation

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
README_DEPLOYMENT.md70 linesDownload Raw Back to root
1# Browser Automation WebUI - Deployment Guide
2
3## Deploying to Hugging Face Spaces
4
5### Prerequisites
6- A Hugging Face account
7- Your code pushed to a Git repository
8
9### Steps to Deploy
10
111. **Create a new Space on Hugging Face**
12   - Go to https://huggingface.co/spaces
13   - Click "Create new Space"
14   - Choose "Gradio" as the SDK
15   - Select your repository or create a new one
16
172. **File Structure for Deployment**
18   ```
19   web-ui/
20   ├── app.py              # Main entry point (created)
21   ├── requirements.txt    # Dependencies
22   ├── src/               # Source code
23   └── README.md          # Documentation
24   ```
25
263. **Key Files for Deployment**
27   - `app.py`: Main entry point that Gradio will use
28   - `requirements.txt`: All necessary dependencies
29   - `src/`: Your source code directory
30
31### Troubleshooting the "Failed to canonicalize script path" Error
32
33This error typically occurs when:
34- Gradio can't find the main entry point
35- Import paths are not properly configured
36- File structure doesn't match deployment expectations
37
38**Solution**: The `app.py` file has been created to serve as the proper entry point for Gradio deployment.
39
40### Environment Variables
41
42If your app requires environment variables, you can set them in the Hugging Face Space settings:
43- Go to your Space settings
44- Navigate to "Repository secrets"
45- Add any required environment variables
46
47### Local Testing
48
49To test the deployment locally before pushing:
50
51```bash
52cd web-ui
53python app.py
54```
55
56This should start the Gradio interface without the canonicalization error.
57
58### Common Issues and Solutions
59
601. **Import Errors**: Make sure all imports use relative paths from the project root
612. **Missing Dependencies**: Ensure all packages are listed in `requirements.txt`
623. **Path Issues**: The `app.py` file includes proper path configuration
63
64### Deployment Checklist
65
66- [ ] `app.py` exists and is properly configured
67- [ ] All dependencies are in `requirements.txt`
68- [ ] All import paths are correct
69- [ ] Environment variables are configured (if needed)
70- [ ] Local testing works without errors