Spaces:
Sleeping
Sleeping
Update app.py
Browse files13 unmodified lines141516171817181959 unmodified lines7980818485828384858614 unmodified lines10110210310710410510610710810911050 unmodified lines16116216316416516616716816917018 unmodified lines1891901911921931941953 unmodified lines19920020120220320420513 unmodified linesfrom tools.gaia_tool import GaiaQAToolfrom tools.wiki_tool import WikiSearchToolfrom tools.search_summary_tool import SearchSummaryToolfrom tools.youtube_species_tool import YouTubeSpeciesToolfrom tools.youtube_transcription_tool import YouTubeTranscriptionToolfrom tools.excel_tool import ExcelToolfrom tools.codegen_tool import CodeGenToolfrom tools.web_search_tool import WebSearchTool59 unmodified lines - Run Python code: PythonExecTool - Web scraping/search: WebSearchTool - Code generation: CodeGenTool
Remember: return only the tool output."""
if not profile: return "Please login to Hugging Face.", None username = profile.username14 unmodified lines StringTool, ChessTool, GroupTool, GroceryTool, PythonExecTool ] tools = [Tool(name=cls().name, func=cls()._run, description=cls().description) for cls in tool_classes] tools = [ Tool(name=cls().name, func=cls()._run, description=cls().description) for cls in tool_classes ] agent = initialize_agent( tools=tools, llm=llm,50 unmodified lines except Exception: raw = agent.run(system_prefix + "\n" + q)
# Убираем заглушки YouTube if isinstance(raw, str) and raw.startswith("ERROR: YouTube"): raw = ""
ans = normalize_answer(raw) results.append({"Task ID": tid, "Question": q, "Submitted Answer": ans}) payload.append({"task_id": tid, "submitted_answer": ans})18 unmodified lines
return status, pd.DataFrame(results)
# Gradio UIwith gr.Blocks() as demo: gr.Markdown("# AI Agents Course — Final Exam Runner")3 unmodified lines table = gr.DataFrame(label="Results") run_btn.click(fn=run_and_submit_all, outputs=[status_box, table])
if __name__ == "__main__": demo.launch(server_name="0.0.0.0", server_port=int(os.environ.get("PORT", 7860)))
app.py+12-5