Rudraprasad commited on
Commit
9497802
·
verified ·
1 Parent(s): e2e4364

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -25
app.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  import requests
4
  import inspect
5
  import pandas as pd
6
- import agent
7
  #
8
  # (Keep Constants as is)
9
  # --- Constants ---
@@ -16,7 +16,7 @@ class BasicAgent:
16
  print("BasicAgent initialized.")
17
  def __call__(self, question: str) -> str:
18
  print(f"Agent received question (first 50 chars): {question[:50]}...")
19
- fixed_answer = agent.chat(question)
20
  print(f"Agent returning fixed answer: {fixed_answer}")
21
  return fixed_answer
22
 
@@ -172,26 +172,26 @@ with gr.Blocks() as demo:
172
  outputs=[status_output, results_table]
173
  )
174
 
175
- if __name__ == "__main__":
176
- print("\n" + "-"*30 + " App Starting " + "-"*30)
177
- # Check for SPACE_HOST and SPACE_ID at startup for information
178
- space_host_startup = os.getenv("SPACE_HOST")
179
- space_id_startup = os.getenv("SPACE_ID") # Get SPACE_ID at startup
180
-
181
- if space_host_startup:
182
- print(f"✅ SPACE_HOST found: {space_host_startup}")
183
- print(f" Runtime URL should be: https://{space_host_startup}.hf.space")
184
- else:
185
- print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
186
-
187
- if space_id_startup: # Print repo URLs if SPACE_ID is found
188
- print(f"✅ SPACE_ID found: {space_id_startup}")
189
- print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
190
- print(f" Repo Tree URL: https://huggingface.co/spaces/{space_id_startup}/tree/main")
191
- else:
192
- print("ℹ️ SPACE_ID environment variable not found (running locally?). Repo URL cannot be determined.")
193
-
194
- print("-"*(60 + len(" App Starting ")) + "\n")
195
-
196
- print("Launching Gradio Interface for Basic Agent Evaluation...")
197
- #demo.launch(debug=True, share=False)
 
3
  import requests
4
  import inspect
5
  import pandas as pd
6
+ import agents
7
  #
8
  # (Keep Constants as is)
9
  # --- Constants ---
 
16
  print("BasicAgent initialized.")
17
  def __call__(self, question: str) -> str:
18
  print(f"Agent received question (first 50 chars): {question[:50]}...")
19
+ fixed_answer = agents.chat(question)
20
  print(f"Agent returning fixed answer: {fixed_answer}")
21
  return fixed_answer
22
 
 
172
  outputs=[status_output, results_table]
173
  )
174
 
175
+ # if __name__ == "__main__":
176
+ # print("\n" + "-"*30 + " App Starting " + "-"*30)
177
+ # # Check for SPACE_HOST and SPACE_ID at startup for information
178
+ # space_host_startup = os.getenv("SPACE_HOST")
179
+ # space_id_startup = os.getenv("SPACE_ID") # Get SPACE_ID at startup
180
+
181
+ # if space_host_startup:
182
+ # print(f"✅ SPACE_HOST found: {space_host_startup}")
183
+ # print(f" Runtime URL should be: https://{space_host_startup}.hf.space")
184
+ # else:
185
+ # print("ℹ️ SPACE_HOST environment variable not found (running locally?).")
186
+
187
+ # if space_id_startup: # Print repo URLs if SPACE_ID is found
188
+ # print(f"✅ SPACE_ID found: {space_id_startup}")
189
+ # print(f" Repo URL: https://huggingface.co/spaces/{space_id_startup}")
190
+ # print(f" Repo Tree URL: https://huggingface.co/spaces/{space_id_startup}/tree/main")
191
+ # else:
192
+ # print("ℹ️ SPACE_ID environment variable not found (running locally?). Repo URL cannot be determined.")
193
+
194
+ # print("-"*(60 + len(" App Starting ")) + "\n")
195
+
196
+ # print("Launching Gradio Interface for Basic Agent Evaluation...")
197
+ # demo.launch(debug=True, share=False)