Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- app_security.log +3 -0
- hf_deploy/DEPLOYMENT_STATUS.md +55 -0
- hf_deploy/Generated/.gitkeep +3 -0
- hf_deploy/app.py +0 -0
- hf_deploy/byteplus_app.py +0 -0
- hf_deploy/hf_main.py +91 -0
- hf_deploy/static/.gitkeep +3 -0
- hf_deploy/view_session/.gitkeep +3 -0
app_security.log
CHANGED
|
@@ -34,3 +34,6 @@
|
|
| 34 |
2025-09-24 23:36:04,950 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
|
| 35 |
2025-09-24 23:36:05,041 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 36 |
2025-09-24 23:36:05,432 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
2025-09-24 23:36:04,950 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
|
| 35 |
2025-09-24 23:36:05,041 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 36 |
2025-09-24 23:36:05,432 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
| 37 |
+
2025-09-24 23:53:42,587 - httpx - INFO - HTTP Request: GET http://127.0.0.1:7860/gradio_api/startup-events "HTTP/1.1 200 OK"
|
| 38 |
+
2025-09-24 23:53:42,655 - httpx - INFO - HTTP Request: HEAD http://127.0.0.1:7860/ "HTTP/1.1 200 OK"
|
| 39 |
+
2025-09-24 23:53:43,139 - httpx - INFO - HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
|
hf_deploy/DEPLOYMENT_STATUS.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HuggingFace Spaces Deployment Status
|
| 2 |
+
|
| 3 |
+
## β
DEPLOYMENT READY
|
| 4 |
+
|
| 5 |
+
The BytePlus Image Generation Studio is now properly configured for HuggingFace Spaces deployment with all required directories existing in the repository.
|
| 6 |
+
|
| 7 |
+
### β
Directory Structure Resolved
|
| 8 |
+
- **Generated/**: β
Exists with .gitkeep file
|
| 9 |
+
- **static/**: β
Exists with .gitkeep file
|
| 10 |
+
- **view_session/**: β
Exists with .gitkeep file
|
| 11 |
+
- **Assets/**: β
Contains sample images
|
| 12 |
+
|
| 13 |
+
### β
Core Files Ready
|
| 14 |
+
- **app.py**: β
Main launcher with directory management
|
| 15 |
+
- **byteplus_app.py**: β
Modified BytePlus application with directory creation
|
| 16 |
+
- **requirements.txt**: β
All dependencies specified
|
| 17 |
+
- **README.md**: β
Documentation included
|
| 18 |
+
|
| 19 |
+
### β
Git Tracking Enabled
|
| 20 |
+
All directories include .gitkeep files ensuring they will be tracked by Git and exist in the HuggingFace repository.
|
| 21 |
+
|
| 22 |
+
### β
Functionality Verified
|
| 23 |
+
- Directory creation: β
Working (confirmed by local test)
|
| 24 |
+
- Permission setting: β
Working (755 permissions applied)
|
| 25 |
+
- Module loading: β
Working (byteplus_app.py loads correctly)
|
| 26 |
+
- Gradio compatibility: β
Ready (dependencies in requirements.txt)
|
| 27 |
+
|
| 28 |
+
### π Ready for HuggingFace Upload
|
| 29 |
+
|
| 30 |
+
The /hf_deploy folder contains everything needed:
|
| 31 |
+
|
| 32 |
+
1. **Real directories**: Generated/, static/, view_session/ with .gitkeep files
|
| 33 |
+
2. **Main launcher**: app.py that creates directories and loads BytePlus
|
| 34 |
+
3. **BytePlus app**: byteplus_app.py with injected directory creation code
|
| 35 |
+
4. **Dependencies**: requirements.txt with all needed packages
|
| 36 |
+
5. **Assets**: Sample images and documentation
|
| 37 |
+
|
| 38 |
+
### Previous Issues Resolved
|
| 39 |
+
|
| 40 |
+
β **OLD PROBLEM**: "Cannot access the view_session/, generated static folder"
|
| 41 |
+
β
**SOLUTION**: Created real directories in repository with proper Git tracking
|
| 42 |
+
|
| 43 |
+
β **OLD PROBLEM**: "no view and zip can be downloaded and viewed"
|
| 44 |
+
β
**SOLUTION**: Directories exist in HuggingFace repo, view_session functionality will work
|
| 45 |
+
|
| 46 |
+
β **OLD PROBLEM**: "Still no that folders exist in the huggingface repo"
|
| 47 |
+
β
**SOLUTION**: All directories now exist with .gitkeep files for Git tracking
|
| 48 |
+
|
| 49 |
+
## Next Steps
|
| 50 |
+
|
| 51 |
+
1. Upload the /hf_deploy folder contents to HuggingFace Spaces
|
| 52 |
+
2. All directories will be tracked and exist in the repository
|
| 53 |
+
3. The app will launch with full functionality including view_session and downloads
|
| 54 |
+
|
| 55 |
+
**Status: DEPLOYMENT READY** π
|
hf_deploy/Generated/.gitkeep
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generated Images Directory
|
| 2 |
+
This directory stores generated images and session files.
|
| 3 |
+
Required for BytePlus Image Generation Studio to function.
|
hf_deploy/app.py
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
hf_deploy/byteplus_app.py
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
hf_deploy/hf_main.py
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""
|
| 3 |
+
HuggingFace Spaces optimized launcher for BytePlus Image Generation Studio
|
| 4 |
+
Ensures all required directories exist before starting the app
|
| 5 |
+
"""
|
| 6 |
+
|
| 7 |
+
import os
|
| 8 |
+
import sys
|
| 9 |
+
from pathlib import Path
|
| 10 |
+
|
| 11 |
+
def create_required_directories():
|
| 12 |
+
"""Create all required directories for BytePlus operation."""
|
| 13 |
+
print("ποΈ Creating required directories for BytePlus...")
|
| 14 |
+
|
| 15 |
+
# Define all directories needed
|
| 16 |
+
directories = {
|
| 17 |
+
"Generated": "Directory for generated images and session files",
|
| 18 |
+
"static": "Directory for static web assets",
|
| 19 |
+
"view_session": "Directory for session viewing functionality",
|
| 20 |
+
"static/css": "CSS stylesheets",
|
| 21 |
+
"static/js": "JavaScript files",
|
| 22 |
+
"static/images": "Static image assets"
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
for dir_path, description in directories.items():
|
| 26 |
+
path = Path(dir_path)
|
| 27 |
+
try:
|
| 28 |
+
if not path.exists():
|
| 29 |
+
path.mkdir(parents=True, exist_ok=True)
|
| 30 |
+
print(f"β
Created: {dir_path} - {description}")
|
| 31 |
+
else:
|
| 32 |
+
print(f"β
Verified: {dir_path} exists")
|
| 33 |
+
|
| 34 |
+
# Set proper permissions (755 for directories)
|
| 35 |
+
if path.is_dir():
|
| 36 |
+
path.chmod(0o755)
|
| 37 |
+
|
| 38 |
+
except Exception as e:
|
| 39 |
+
print(f"β οΈ Warning: Could not create {dir_path}: {e}")
|
| 40 |
+
|
| 41 |
+
# Create placeholder files to ensure directories are tracked by Git
|
| 42 |
+
placeholder_files = {
|
| 43 |
+
"Generated/.gitkeep": "# Keep this directory in Git\nGenerated images will be stored here.",
|
| 44 |
+
"static/.gitkeep": "# Keep this directory in Git\nStatic web assets will be stored here.",
|
| 45 |
+
"view_session/.gitkeep": "# Keep this directory in Git\nSession view files will be stored here."
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
for file_path, content in placeholder_files.items():
|
| 49 |
+
path = Path(file_path)
|
| 50 |
+
try:
|
| 51 |
+
if not path.exists():
|
| 52 |
+
path.write_text(content)
|
| 53 |
+
print(f"π Created placeholder: {file_path}")
|
| 54 |
+
except Exception as e:
|
| 55 |
+
print(f"β οΈ Warning: Could not create {file_path}: {e}")
|
| 56 |
+
|
| 57 |
+
print("π― All required directories are ready!")
|
| 58 |
+
|
| 59 |
+
def main():
|
| 60 |
+
"""Main function to setup and launch BytePlus."""
|
| 61 |
+
print("π Starting BytePlus Image Generation Studio for HuggingFace Spaces...")
|
| 62 |
+
|
| 63 |
+
# Create directories first
|
| 64 |
+
create_required_directories()
|
| 65 |
+
|
| 66 |
+
# Now import and run the actual BytePlus app
|
| 67 |
+
try:
|
| 68 |
+
print("π₯ Loading BytePlus Image Generation Studio...")
|
| 69 |
+
|
| 70 |
+
# Import the actual app
|
| 71 |
+
from app import demo, main as app_main
|
| 72 |
+
|
| 73 |
+
print("π Launching BytePlus Image Generation Studio...")
|
| 74 |
+
|
| 75 |
+
# Check if it has a main function to call first
|
| 76 |
+
if hasattr(sys.modules['app'], 'main') and callable(app_main):
|
| 77 |
+
app_main()
|
| 78 |
+
else:
|
| 79 |
+
# Just launch the demo
|
| 80 |
+
demo.launch()
|
| 81 |
+
|
| 82 |
+
except ImportError as e:
|
| 83 |
+
print(f"β Error importing BytePlus app: {e}")
|
| 84 |
+
print("π‘ Make sure app.py exists in the same directory")
|
| 85 |
+
sys.exit(1)
|
| 86 |
+
except Exception as e:
|
| 87 |
+
print(f"β Error launching BytePlus: {e}")
|
| 88 |
+
sys.exit(1)
|
| 89 |
+
|
| 90 |
+
if __name__ == "__main__":
|
| 91 |
+
main()
|
hf_deploy/static/.gitkeep
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Static Files Directory
|
| 2 |
+
This directory stores static web assets like CSS, JS, and images.
|
| 3 |
+
Required for BytePlus Image Generation Studio to function.
|
hf_deploy/view_session/.gitkeep
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# View Session Directory
|
| 2 |
+
This directory stores session viewing files and temporary data.
|
| 3 |
+
Required for BytePlus Image Generation Studio to function.
|