Melatonini commited on
Commit
79a9a31
·
1 Parent(s): d86fd07

Fix ZeroGPU startup error by decorating the Gradio submit handler.

Browse files

ZeroGPU Spaces require @spaces.GPU on the function bound to .click(); add spaces import and 1h duration budget for the full eval run.

Files changed (2) hide show
  1. app.py +3 -1
  2. requirements.txt +1 -0
app.py CHANGED
@@ -3,6 +3,7 @@ import os
3
  import gradio as gr
4
  import pandas as pd
5
  import requests
 
6
 
7
  from files import download_task_file
8
 
@@ -10,7 +11,8 @@ from files import download_task_file
10
  # --- Constants ---
11
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
12
 
13
- def run_and_submit_all( profile: gr.OAuthProfile | None):
 
14
  """
15
  Fetches all questions, runs the BasicAgent on them, submits all answers,
16
  and displays the results.
 
3
  import gradio as gr
4
  import pandas as pd
5
  import requests
6
+ import spaces
7
 
8
  from files import download_task_file
9
 
 
11
  # --- Constants ---
12
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
13
 
14
+ @spaces.GPU(duration=3600)
15
+ def run_and_submit_all(profile: gr.OAuthProfile | None):
16
  """
17
  Fetches all questions, runs the BasicAgent on them, submits all answers,
18
  and displays the results.
requirements.txt CHANGED
@@ -7,3 +7,4 @@ openpyxl
7
  youtube-transcript-api
8
  Pillow
9
  datasets
 
 
7
  youtube-transcript-api
8
  Pillow
9
  datasets
10
+ spaces