eliel2003 commited on
Commit
a5718f1
·
verified ·
1 Parent(s): eb57eae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -12,6 +12,8 @@
12
  # HF_TOKEN → your HF token (optional — enables Mistral API)
13
  # ============================================================
14
 
 
 
15
  import os
16
  import json
17
  import warnings
@@ -181,6 +183,7 @@ def load_all():
181
  # CORE ENGINE
182
  # ============================================================
183
 
 
184
  def _call_llm(prompt: str, max_new_tokens: int = 450) -> str:
185
  if _gen_backend == "api":
186
  return _gen_client.text_generation(
@@ -208,6 +211,7 @@ def _build_prompt(system_msg: str, user_msg: str) -> str:
208
  )
209
 
210
 
 
211
  def recommend_vendors(
212
  event_brief: str, event_city: str,
213
  event_season: str, total_budget_usd: float, top_n: int = 3,
@@ -580,4 +584,4 @@ with gr.Blocks(theme=gr.themes.Soft(), css=CSS, title="ProSync AI") as demo:
580
 
581
 
582
  if __name__ == "__main__":
583
- demo.launch()
 
12
  # HF_TOKEN → your HF token (optional — enables Mistral API)
13
  # ============================================================
14
 
15
+ import spaces # must be first — HF GPU Spaces require this
16
+
17
  import os
18
  import json
19
  import warnings
 
183
  # CORE ENGINE
184
  # ============================================================
185
 
186
+ @spaces.GPU
187
  def _call_llm(prompt: str, max_new_tokens: int = 450) -> str:
188
  if _gen_backend == "api":
189
  return _gen_client.text_generation(
 
211
  )
212
 
213
 
214
+ @spaces.GPU
215
  def recommend_vendors(
216
  event_brief: str, event_city: str,
217
  event_season: str, total_budget_usd: float, top_n: int = 3,
 
584
 
585
 
586
  if __name__ == "__main__":
587
+ demo.launch()