Update app.py
Browse files
app.py
CHANGED
@@ -37,17 +37,14 @@ async def run_and_submit_all( profile= None):
|
|
37 |
and displays the results.
|
38 |
"""
|
39 |
# --- Determine HF Space Runtime URL and Repo URL ---
|
40 |
-
|
41 |
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
username = "oremaz"
|
50 |
-
print(f"Running as: {username}")
|
51 |
|
52 |
api_url = DEFAULT_API_URL
|
53 |
questions_url = f"{api_url}/questions"
|
@@ -174,7 +171,7 @@ with gr.Blocks() as demo:
|
|
174 |
"""
|
175 |
)
|
176 |
|
177 |
-
|
178 |
|
179 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
180 |
|
|
|
37 |
and displays the results.
|
38 |
"""
|
39 |
# --- Determine HF Space Runtime URL and Repo URL ---
|
40 |
+
space_id = os.getenv("SPACE_ID") # Get the SPACE_ID for sending link to the code
|
41 |
|
42 |
+
if profile:
|
43 |
+
username= f"{profile.username}"
|
44 |
+
print(f"User logged in: {username}")
|
45 |
+
else:
|
46 |
+
print("User not logged in.")
|
47 |
+
return "Please Login to Hugging Face with the button.", None
|
|
|
|
|
|
|
48 |
|
49 |
api_url = DEFAULT_API_URL
|
50 |
questions_url = f"{api_url}/questions"
|
|
|
171 |
"""
|
172 |
)
|
173 |
|
174 |
+
gr.LoginButton()
|
175 |
|
176 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
177 |
|