gsgoncalves commited on
Commit
2fb7003
·
verified ·
1 Parent(s): 17f7c10

Upload api.py

Browse files
Files changed (1) hide show
  1. api.py +6 -6
api.py CHANGED
@@ -24,12 +24,12 @@ class GAIAHFAPIClient:
24
  def __init__(self, profile: gr.OAuthProfile | None, api_base_url=DEFAULT_API_URL):
25
  # --- Determine HF Space Runtime URL and Repo URL ---
26
  space_id = os.getenv("SPACE_ID") # Get the SPACE_ID for sending link to the code
27
- #if profile:
28
- # self.username = f"{profile.username}"
29
- # logger.info(f"User logged in: {self.username}")
30
- #else:
31
- # logger.warning("User not logged in.")
32
- # return "Please Login to Hugging Face with the button.", None
33
  self.agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
34
  self.questions_url = f"{api_base_url}/questions"
35
  self.random_question_url = f"{api_base_url}/random-question"
 
24
  def __init__(self, profile: gr.OAuthProfile | None, api_base_url=DEFAULT_API_URL):
25
  # --- Determine HF Space Runtime URL and Repo URL ---
26
  space_id = os.getenv("SPACE_ID") # Get the SPACE_ID for sending link to the code
27
+ if profile:
28
+ self.username = f"{profile.username}"
29
+ logger.info(f"User logged in: {self.username}")
30
+ else:
31
+ logger.warning("User not logged in.")
32
+ return "Please Login to Hugging Face with the button.", None
33
  self.agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
34
  self.questions_url = f"{api_base_url}/questions"
35
  self.random_question_url = f"{api_base_url}/random-question"