waliullah123 commited on
Commit
e5d2b9a
·
verified ·
1 Parent(s): a2cc0c2

fix: add @spaces.GPU decorator for ZeroGPU compatibility

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -660,8 +660,10 @@ load_models()
660
  # Flask directly via gunicorn. This block is kept for legacy compatibility.
661
  try:
662
  import gradio as gr
 
663
  from fastapi.middleware.wsgi import WSGIMiddleware
664
 
 
665
  def predict_gradio(statement, model_type):
666
  if not statement or len(statement) < 5:
667
  return "Please enter a statement with at least 5 characters."
 
660
  # Flask directly via gunicorn. This block is kept for legacy compatibility.
661
  try:
662
  import gradio as gr
663
+ import spaces
664
  from fastapi.middleware.wsgi import WSGIMiddleware
665
 
666
+ @spaces.GPU
667
  def predict_gradio(statement, model_type):
668
  if not statement or len(statement) < 5:
669
  return "Please enter a statement with at least 5 characters."