Commit History
-
Add follow-up deployment support: Update existing spaces instead of creating new ones
Implemented the same pattern as original deploy.py where follow-up prompts update the existing deployed space with new commits instead of creating new spaces. backend_deploy.py changes: - Added existing_repo_id parameter to deploy_to_huggingface_space() - Added commit_message parameter for custom commit messages - Added is_update logic to detect updates vs new deployments - Skip create_repo() when updating existing space - Use appropriate commit message: "Update from anycoder" vs "Deploy from anycoder" - Return different success message: "Updated" vs "Deployed" - Skip 2-second wait for README on updates (already exists) backend_api.py changes: - Updated DeploymentRequest model to include: * existing_repo_id (optional) - for explicitly updating a space * commit_message (optional) - custom commit message * space_name now optional (not needed for updates) - Added deployed_spaces tracking to user_sessions - Deploy endpoint now: * Checks session for previously deployed spaces * …fe27a3c -
Fix backend_deploy: Let HuggingFace auto-create README, only add anycoder tag
Issue: Previously was creating README with hardcoded SDK version (4.44.1) Fix: Follow the original deploy.py pattern Changes: - Removed create_minimal_readme() function - not needed - Don't manually create or upload README.md during deployment - Let HuggingFace automatically generate README.md with proper defaults - After deployment, only modify the auto-generated README to add: * tags: anycoder (preserves all existing content) * app_port: 7860 (only for Docker spaces) Deployment flow now: 1. Parse code based on language (html, gradio, streamlit, react, etc.) 2. Write code files to temp directory (no README) 3. Create space with create_repo() - HF auto-generates README 4. Upload files with upload_folder() 5. Wait 2 seconds for README generation 6. Call add_anycoder_tag_to_readme() to modify existing README 7. Preserves all HF defaults (versions, metadata, etc.) This ensures: - No hardcoded versions (HF uses latest compatible versions) - Existing README content is preserved - Onl…3d9f57c -
Add standalone backend_deploy.py without Gradio dependencies
Created backend_deploy.py as a standalone deployment utility that can be used by the backend API without any Gradio dependencies. This module provides clean deployment functions for HuggingFace Spaces. Key features: - deploy_to_huggingface_space(): Main deployment function supporting all language types (HTML, Gradio, Streamlit, React, Transformers.js, ComfyUI) - Automatic SDK detection and appropriate file structure generation - Multi-file support (README, Dockerfile, requirements.txt, etc.) - update_space_file(): Update individual files in existing spaces - delete_space(): Delete spaces - list_user_spaces(): List all user spaces Code parsing utilities: - parse_html_code(): Extract HTML from various formats - parse_transformers_js_output(): Parse multi-file transformers.js output - parse_python_requirements(): Extract requirements.txt - parse_multi_file_python_output(): Parse Gradio/Streamlit multi-file apps - is_streamlit_code() / is_gradio_code(): Code type detection - detect_sdk…ba8977c