Spaces:
Runtime error
Runtime error
Update app.py
Browse files41 unmodified lines4243444546474849505152535455565758120 unmodified lines1791801811821831841851861873 unmodified lines19119219319419519619741 unmodified lines# --- Gradio UI and Logic ---def run_and_submit_all(api_url: str, username: str):"""Fetches all questions, runs the BasicAgent on them, submits all answers,and displays the results."""if not api_url:return "Please enter the API URL.", None # Status, DataFrameif not username:return "Please enter your Hugging Face username.", None # Status, DataFrameapi_url = api_url.strip('/')questions_url = f"{api_url}/questions"submit_url = f"{api_url}/submit"120 unmodified lines"submit all answers at once, and display the results.")with gr.Row():api_url_input = gr.Textbox(label="FastAPI API URL", value=DEFAULT_API_URL)hf_username_input = gr.Textbox(label="Hugging Face Username")run_button = gr.Button("Run Evaluation & Submit All Answers")3 unmodified lines# --- Component Interaction ---run_button.click(fn=run_and_submit_all,inputs=[api_url_input, hf_username_input],outputs=[status_output, results_table])41 unmodified lines42434445464748495051525354555657585960120 unmodified lines1811821831841851861873 unmodified lines19119219319419519641 unmodified lines# --- Gradio UI and Logic ---def run_and_submit_all( profile gr.OAuthProfile , api_url: str):"""Fetches all questions, runs the BasicAgent on them, submits all answers,and displays the results."""if profile:username= f"{profile.name}"else:return "Please Login to Hugging Face with the button.", Noneapi_url = DEFAULT_API_URLquestions_url = f"{api_url}/questions"submit_url = f"{api_url}/submit"120 unmodified lines"submit all answers at once, and display the results.")gr.LoginButton()run_button = gr.Button("Run Evaluation & Submit All Answers")3 unmodified lines# --- Component Interaction ---run_button.click(fn=run_and_submit_all,outputs=[status_output, results_table])
app.py+10-11