hassenhamdi commited on
Commit
e205d28
·
verified ·
1 Parent(s): 6f7cbc1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -4,8 +4,6 @@ import gradio as gr
4
  import logging
5
  import time
6
 
7
-
8
- # Import the new Settings, Evaluator, and Runner classes
9
  from settings import Settings
10
  from evaluator import Evaluator
11
  from runner import Runner
@@ -14,13 +12,14 @@ from runner import Runner
14
  logging.basicConfig(level=logging.INFO, force=True)
15
  logger = logging.getLogger(__name__)
16
 
17
- # Initialize settings, evaluator, and runner
18
- settings = Settings()
 
 
19
  evaluator = Evaluator(settings)
20
  runner = Runner(settings)
21
 
22
 
23
-
24
  LOGIN_MESSAGE = "Please Login to Hugging Face with the button."
25
  EMPTY_RESULTS_TABLE = pd.DataFrame(columns=['task_id', 'question', 'answer'])
26
 
@@ -97,7 +96,7 @@ with gr.Blocks() as demo:
97
  * Running 'Get All Answers' can take significant time as the agent processes all 20 questions.
98
  * Agent logs are detailed (DEBUG level) and may appear interleaved due to parallel execution.
99
  * The 'Submit Answers' button uses the most recent agent answers cached locally for your username.
100
- * **API Keys Required:** Ensure `GEMINI_API_KEY` is set as a Space Secret (or environment variable if running locally).
101
  """
102
  )
103
 
 
4
  import logging
5
  import time
6
 
 
 
7
  from settings import Settings
8
  from evaluator import Evaluator
9
  from runner import Runner
 
12
  logging.basicConfig(level=logging.INFO, force=True)
13
  logger = logging.getLogger(__name__)
14
 
15
+ settings = Settings(
16
+ username=os.getenv("USERNAME"),
17
+ space_id=os.getenv("SPACE_ID")
18
+ )
19
  evaluator = Evaluator(settings)
20
  runner = Runner(settings)
21
 
22
 
 
23
  LOGIN_MESSAGE = "Please Login to Hugging Face with the button."
24
  EMPTY_RESULTS_TABLE = pd.DataFrame(columns=['task_id', 'question', 'answer'])
25
 
 
96
  * Running 'Get All Answers' can take significant time as the agent processes all 20 questions.
97
  * Agent logs are detailed (DEBUG level) and may appear interleaved due to parallel execution.
98
  * The 'Submit Answers' button uses the most recent agent answers cached locally for your username.
99
+ * **API Keys Required:** Ensure `GEMINI_API_KEY`, `USERNAME`, and `SPACE_ID` are set as Space Secrets (or environment variables if running locally).
100
  """
101
  )
102