yukee1992 commited on
Commit
d109575
·
verified ·
1 Parent(s): 5c6748a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -23
app.py CHANGED
@@ -19,9 +19,6 @@ import uuid
19
  import hashlib
20
  from enum import Enum
21
  import random
22
- # Add these imports at the top (after existing imports)
23
- import threading
24
- from fastapi.middleware.wsgi import WSGIMiddleware
25
 
26
  # External OCI API URL - YOUR BUCKET SAVING API
27
  OCI_API_BASE_URL = "https://yukee1992-oci-story-book.hf.space"
@@ -814,27 +811,8 @@ def create_gradio_interface():
814
  # Create Gradio app
815
  gradio_app = create_gradio_interface()
816
 
817
- @app.get("/")
818
- async def root():
819
- return {
820
- "message": "Storybook Generator API + UI is running!",
821
- "features": [
822
- "API: Complete storybook generation to OCI bucket",
823
- "UI: Test image generation with local file management",
824
- "File Management: View, download, delete local images"
825
- ],
826
- "endpoints": {
827
- "generate_storybook": "POST /api/generate-storybook",
828
- "check_status": "GET /api/job-status/{job_id}",
829
- "local_images": "GET /api/local-images"
830
- }
831
- }
832
-
833
- # For Hugging Face Spaces deployment
834
- def get_app():
835
- return app
836
-
837
  # Mount Gradio under a specific path to avoid conflicts
 
838
  app.mount("/ui", WSGIMiddleware(gradio_app.server))
839
 
840
  # Enhanced root endpoint that explains the API structure
 
19
  import hashlib
20
  from enum import Enum
21
  import random
 
 
 
22
 
23
  # External OCI API URL - YOUR BUCKET SAVING API
24
  OCI_API_BASE_URL = "https://yukee1992-oci-story-book.hf.space"
 
811
  # Create Gradio app
812
  gradio_app = create_gradio_interface()
813
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
814
  # Mount Gradio under a specific path to avoid conflicts
815
+ from fastapi.middleware.wsgi import WSGIMiddleware
816
  app.mount("/ui", WSGIMiddleware(gradio_app.server))
817
 
818
  # Enhanced root endpoint that explains the API structure