Spaces:
Sleeping
Sleeping
Delete hf_backend
Browse files- hf_backend/Dockerfile +0 -34
- hf_backend/README.md +0 -35
- hf_backend/app.py +0 -25
- hf_backend/requirements.txt +0 -21
hf_backend/Dockerfile
DELETED
|
@@ -1,34 +0,0 @@
|
|
| 1 |
-
# Hugging Face Spaces Docker Backend
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
-
|
| 4 |
-
WORKDIR /app
|
| 5 |
-
|
| 6 |
-
# Install system dependencies
|
| 7 |
-
RUN apt-get update && apt-get install -y \
|
| 8 |
-
build-essential \
|
| 9 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
-
|
| 11 |
-
# Copy requirements first for caching
|
| 12 |
-
COPY hf_backend/requirements.txt ./requirements.txt
|
| 13 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
-
|
| 15 |
-
# Copy LangGraph workflow code
|
| 16 |
-
COPY mh_langgraph_workflow/ ./mh_langgraph_workflow/
|
| 17 |
-
|
| 18 |
-
# Copy backend API server
|
| 19 |
-
COPY magicHourApp/api_server.py ./magicHourApp/api_server.py
|
| 20 |
-
|
| 21 |
-
# Copy the HF app wrapper
|
| 22 |
-
COPY hf_backend/app.py ./app.py
|
| 23 |
-
|
| 24 |
-
# Set environment variables
|
| 25 |
-
ENV PRODUCTION=true
|
| 26 |
-
ENV PYTHONUNBUFFERED=1
|
| 27 |
-
ENV PORT=7860
|
| 28 |
-
|
| 29 |
-
# Expose HF Spaces default port
|
| 30 |
-
EXPOSE 7860
|
| 31 |
-
|
| 32 |
-
# Run the app
|
| 33 |
-
CMD ["python", "app.py"]
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hf_backend/README.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Magic Hour AI Backend
|
| 3 |
-
emoji: ✨
|
| 4 |
-
colorFrom: purple
|
| 5 |
-
colorTo: blue
|
| 6 |
-
sdk: docker
|
| 7 |
-
pinned: false
|
| 8 |
-
license: mit
|
| 9 |
-
app_port: 7860
|
| 10 |
-
---
|
| 11 |
-
|
| 12 |
-
# Magic Hour AI Backend
|
| 13 |
-
|
| 14 |
-
This is the FastAPI backend for Magic Hour AI, a multimodal content generation agent powered by LangGraph.
|
| 15 |
-
|
| 16 |
-
## Features
|
| 17 |
-
|
| 18 |
-
- 🎨 AI Image Generation (via fal.ai)
|
| 19 |
-
- 🎬 AI Video Generation
|
| 20 |
-
- ✏️ Image Editing
|
| 21 |
-
- 🧠 Intelligent context-aware agent with memory
|
| 22 |
-
- 📡 Real-time streaming responses via SSE
|
| 23 |
-
|
| 24 |
-
## API Endpoints
|
| 25 |
-
|
| 26 |
-
- `GET /api/health` - Health check
|
| 27 |
-
- `POST /api/chat` - Main chat endpoint (SSE streaming)
|
| 28 |
-
|
| 29 |
-
## Environment Variables
|
| 30 |
-
|
| 31 |
-
Set these in your Hugging Face Space secrets:
|
| 32 |
-
|
| 33 |
-
- `FAL_KEY` - Your fal.ai API key (required)
|
| 34 |
-
- `FAL_MODEL_NAME` - LLM model to use (default: google/gemini-2.5-flash)
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hf_backend/app.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Hugging Face Spaces Backend for Magic Hour AI
|
| 3 |
-
This is a wrapper that imports and runs the main API server
|
| 4 |
-
"""
|
| 5 |
-
|
| 6 |
-
import sys
|
| 7 |
-
import os
|
| 8 |
-
|
| 9 |
-
# Add parent directory to path for imports
|
| 10 |
-
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
| 11 |
-
|
| 12 |
-
# Set production mode
|
| 13 |
-
os.environ["PRODUCTION"] = "true"
|
| 14 |
-
|
| 15 |
-
# Import the FastAPI app from magicHourApp
|
| 16 |
-
from magicHourApp.api_server import app
|
| 17 |
-
|
| 18 |
-
# Hugging Face Spaces expects the app to be named 'app'
|
| 19 |
-
# The app is already configured and ready to use
|
| 20 |
-
|
| 21 |
-
if __name__ == "__main__":
|
| 22 |
-
import uvicorn
|
| 23 |
-
port = int(os.environ.get("PORT", 7860)) # HF Spaces uses 7860 by default
|
| 24 |
-
uvicorn.run(app, host="0.0.0.0", port=port)
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hf_backend/requirements.txt
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
# Hugging Face Spaces Backend Requirements
|
| 2 |
-
# Core FastAPI
|
| 3 |
-
fastapi>=0.104.0
|
| 4 |
-
uvicorn[standard]>=0.24.0
|
| 5 |
-
python-multipart>=0.0.6
|
| 6 |
-
|
| 7 |
-
# LangGraph and LangChain
|
| 8 |
-
langgraph>=0.2.0
|
| 9 |
-
langchain>=0.3.0
|
| 10 |
-
langchain-core>=0.3.0
|
| 11 |
-
langchain-community>=0.3.0
|
| 12 |
-
|
| 13 |
-
# Fal.ai for LLM and image generation
|
| 14 |
-
fal-client>=0.5.0
|
| 15 |
-
|
| 16 |
-
# Utilities
|
| 17 |
-
pydantic>=2.0.0
|
| 18 |
-
httpx>=0.25.0
|
| 19 |
-
aiofiles>=23.2.0
|
| 20 |
-
Pillow>=10.0.0
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|