uttarasawant commited on
Commit
8d67bdf
·
verified ·
1 Parent(s): 0a6e2c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -2
app.py CHANGED
@@ -1,3 +1,13 @@
 
 
 
 
 
 
 
 
 
 
1
  import torch
2
  import pandas as pd
3
  import gradio as gr
@@ -41,6 +51,7 @@ def sample_frames_from_video(video_path, num_frames=4):
41
  # =====================================================================
42
  # 🧠 CHEF LOGIC ENGINE
43
  # =====================================================================
 
44
  def process_kitchen_operations(media_input, budget, days):
45
  # GUARD: Stop if no input provided
46
  if media_input is None:
@@ -77,7 +88,7 @@ def process_kitchen_operations(media_input, budget, days):
77
  # =====================================================================
78
  # 🎨 GRADIO INTERFACE
79
  # =====================================================================
80
- with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
81
  gr.Markdown("# 🛰️ Parallel Plate: Digital Twin Chef Engine")
82
 
83
  with gr.Tabs():
@@ -119,4 +130,4 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
119
  )
120
 
121
  if __name__ == "__main__":
122
- demo.launch()
 
1
+ # =====================================================================
2
+ # 🛸 HUGGING FACE ZERO-GPU INITIALIZATION (MUST BE FIRST)
3
+ # =====================================================================
4
+ import sys
5
+ # This forces spaces to load right away if it's installed in the HF container
6
+ try:
7
+ import spaces
8
+ except ImportError:
9
+ pass
10
+
11
  import torch
12
  import pandas as pd
13
  import gradio as gr
 
51
  # =====================================================================
52
  # 🧠 CHEF LOGIC ENGINE
53
  # =====================================================================
54
+ @spaces.GPU(duration=120)
55
  def process_kitchen_operations(media_input, budget, days):
56
  # GUARD: Stop if no input provided
57
  if media_input is None:
 
88
  # =====================================================================
89
  # 🎨 GRADIO INTERFACE
90
  # =====================================================================
91
+ with gr.Blocks() as demo:
92
  gr.Markdown("# 🛰️ Parallel Plate: Digital Twin Chef Engine")
93
 
94
  with gr.Tabs():
 
130
  )
131
 
132
  if __name__ == "__main__":
133
+ demo.launch(theme=gr.themes.Monochrome())