sandhyasinha655 commited on
Commit
9342563
·
verified ·
1 Parent(s): 77162ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -34,7 +34,6 @@ def face_swap_logic(source_path, target_path):
34
  return output_path
35
 
36
  # --- Gradio UI (Yeh Web Users ke liye hai) ---
37
- # Isse hum 'ui_app' naam denge
38
  with gr.Blocks(theme=gr.themes.Soft()) as ui_app:
39
  gr.Markdown("# 🎭 Roop Face Swap AI")
40
  with gr.Tabs():
@@ -58,7 +57,6 @@ with gr.Blocks(theme=gr.themes.Soft()) as ui_app:
58
  submit_btn_video.click(fn=web_ui_swap, inputs=[source_face_vid, target_video], outputs=result_video)
59
 
60
  # --- Naya API Code (Yeh Aapke Android App ke liye hai) ---
61
- # Hum ek FastAPI app banayenge
62
  app = FastAPI()
63
 
64
  def save_base64_to_file(b64_string, extension):
@@ -93,5 +91,8 @@ async def api_face_swap(payload: dict):
93
  else:
94
  return {"error": "Face swap fail hua."}
95
 
96
- # Gradio UI aur FastAPI API, dono ko ek saath mount karein
97
- app = gr.mount_app(app, ui_app, path="/")
 
 
 
 
34
  return output_path
35
 
36
  # --- Gradio UI (Yeh Web Users ke liye hai) ---
 
37
  with gr.Blocks(theme=gr.themes.Soft()) as ui_app:
38
  gr.Markdown("# 🎭 Roop Face Swap AI")
39
  with gr.Tabs():
 
57
  submit_btn_video.click(fn=web_ui_swap, inputs=[source_face_vid, target_video], outputs=result_video)
58
 
59
  # --- Naya API Code (Yeh Aapke Android App ke liye hai) ---
 
60
  app = FastAPI()
61
 
62
  def save_base64_to_file(b64_string, extension):
 
91
  else:
92
  return {"error": "Face swap fail hua."}
93
 
94
+ # ===== YAHAN MERI GALTI THI, AB THEEK HAI =====
95
+ # OLD: app = gr.mount_app(app, ui_app, path="/")
96
+ # NEW: Sahi function ka naam 'mount_gradio_app' hai
97
+ app = gr.mount_gradio_app(app, ui_app, path="/")
98
+ # ===============================================