Spaces:
Sleeping
Sleeping
Commit History
23 days ago
-
Update app.py
Verified signature"""HF Agents Course 최종 과제 - 다단계 에이전트 버전 (Gemini 또는 Hugging Face) LLM이 한 단계에 하나의 도구를 골라 쓰고(검색/위키/웹페이지/파이썬/유튜브 자막), 결과를 보고 다음 단계를 정합니다. 최대 MAX_STEPS 단계 안에 최종 답을 내도록 제한해 비용을 통제합니다. """ import base64 import json import mimetypes import os import re import subprocess import sys import tempfile import threading import time from collections import deque import gradio as gr import pandas as pd import requests # ZeroGPU 하드웨어에서 시작 오류를 막기 위한 더미 함수 (CPU 하드웨어에서는 무시됨) try: import spaces @spaces.GPU def _gpu_placeholder(): return "ok" except ImportError: pass try: from ddgs import DDGS except ImportError: try: from duckduckgo_search import DDGS except ImportError: DDGS = None # --------------------------------------------------------------------------- # 설정 (Space Variables/Secrets로 조정) # --------------------------------------------------------------------------- SCORING_API = "https://agents-course-unit4-scoring.hf.space" GEMINI_API = "https:…a212dc5 -
Update app.py
Verified signature"""HF Agents Course 최종 과제 - Gemini 또는 Hugging Face 선택형 경량 버전 설계 원칙: 문항당 LLM 호출 1회. 웹 검색(호출 없음) -> 검색 결과 + 첨부 파일을 한 번에 Gemini에 전달 -> 최종 답만 받음 """ import base64 import json import mimetypes import os import re import time from collections import deque import gradio as gr import pandas as pd import requests # ZeroGPU 하드웨어에서 시작 오류를 막기 위한 더미 함수 (CPU 하드웨어에서는 무시됨) try: import spaces @spaces.GPU def _gpu_placeholder(): return "ok" except ImportError: pass try: from ddgs import DDGS except ImportError: try: from duckduckgo_search import DDGS except ImportError: DDGS = None # --------------------------------------------------------------------------- # 설정 (Space Variables/Secrets로 조정) # --------------------------------------------------------------------------- SCORING_API = "https://agents-course-unit4-scoring.hf.space" GEMINI_API = "https://generativelanguage.googleapis.com/v1beta" FILES_DIR = "/tmp/task_files" CACHE_PATH = "/tmp/answ…43846ee -
Update app.py
Verified signature7bda50e -
Update app.py
Verified signatureimport glob import json import os import re import threading import time from collections import deque from concurrent.futures import ThreadPoolExecutor, wait, FIRST_COMPLETED # litellm의 재시도 기능에 필요한 tenacity가 없으면 시작 시 자동 설치 try: import tenacity # noqa: F401 except ImportError: import subprocess import sys subprocess.run([sys.executable, "-m", "pip", "install", "tenacity"], check=False) import gradio as gr import pandas as pd import requests from smolagents import ( CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, LiteLLMModel, VisitWebpageTool, tool, ) # ZeroGPU 하드웨어에서 시작 오류를 막기 위한 더미 함수 (CPU 하드웨어에서는 무시됨) try: import spaces @spaces.GPU def _gpu_placeholder(): return "ok" except ImportError: pass # --------------------------------------------------------------------------- # 설정 (Space의 Variables에서 조정 가능) # --------------------------------------------------------------------------- DEFAULT_API_URL = "https://age…1520c10 -
Update app.py
Verified signatureimport glob import json import os import re import threading import time from collections import deque from concurrent.futures import ThreadPoolExecutor, wait, FIRST_COMPLETED import gradio as gr import pandas as pd import requests from smolagents import ( CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, LiteLLMModel, VisitWebpageTool, tool, ) # ZeroGPU 하드웨어에서 시작 오류를 막기 위한 더미 함수 (CPU 하드웨어에서는 무시됨) try: import spaces @spaces.GPU def _gpu_placeholder(): return "ok" except ImportError: pass # --------------------------------------------------------------------------- # 설정 (Space의 Variables에서 조정 가능) # --------------------------------------------------------------------------- DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space" FILES_DIR = "/tmp/task_files" CACHE_PATH = "/tmp/answers_cache.json" os.makedirs(FILES_DIR, exist_ok=True) WORKERS = int(os.getenv("WORKERS", "2")) # 동시 실행 문항 수 QUESTION_TIMEO…9564d9d -
Update app.py
Verified signatureimport json import os import re import threading import time from concurrent.futures import ThreadPoolExecutor, as_completed import gradio as gr import pandas as pd import requests from smolagents import ( CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, LiteLLMModel, VisitWebpageTool, tool, ) # ZeroGPU 하드웨어에서 시작 오류를 막기 위한 안전한 더미 함수 try: import spaces @spaces.GPU def _gpu_placeholder(): return "ok" except ImportError: pass # --------------------------------------------------------------------------- # 설정 (Space의 Variables 또는 Secrets에서 조정 가능) # --------------------------------------------------------------------------- DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space" FILES_DIR = "/tmp/task_files" CACHE_PATH = "/tmp/answers_cache.json" os.makedirs(FILES_DIR, exist_ok=True) WORKERS = int(os.getenv("WORKERS", "3")) # 동시 실행 문항 수 QUESTION_TIMEOUT = int(os.getenv("QUESTION_TIMEOUT", "240")) # 문항당 제한…aacc1dd -
Update app.py
Verified signatureimport json import os import re import threading import time from concurrent.futures import ThreadPoolExecutor, as_completed import gradio as gr import pandas as pd import requests from smolagents import ( CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, LiteLLMModel, VisitWebpageTool, tool, ) # ZeroGPU 하드웨어에서 시작 오류를 막기 위한 더미 함수 (CPU 하드웨어에서는 무시됨) try: import spaces @spaces.GPU def _gpu_placeholder(): return "ok" except ImportError: pass # --------------------------------------------------------------------------- # 설정 (Space의 Variables에서 조정 가능) # --------------------------------------------------------------------------- DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space" FILES_DIR = "/tmp/task_files" CACHE_PATH = "/tmp/answers_cache.json" os.makedirs(FILES_DIR, exist_ok=True) WORKERS = int(os.getenv("WORKERS", "3")) # 동시 실행 문항 수 QUESTION_TIMEOUT = int(os.getenv("QUESTION_TIMEOUT", "240")) # 문…6172d6b
24 days ago
-
Update app.py
Verified signature07f8a9d
-
Update app.py
Verified signature81917a3 -
Update app.py
Verified signature0ee0419 -
Update app.py
Verified signaturee514fd7 -
Update app.py
Verified signatured59f015 -
Update app.py
Verified signature36ed51a -
Update app.py
Verified signature3db6293 -
Update app.py
Verified signaturec1fd3d2
-
Update app.py
Verified signatureb177367 -
Update app.py
Verified signature7d65c66 -
Update app.py
Verified signature9088b99 -
Update app.py
Verified signature3c4371f -
Update app.py
Verified signature9cde2c4 -
Update app.py
Verified signature3e5c3a6
-
Update app.py
Verified signature45d779e -
Update app.py
Verified signature1ca9f65 -
Update app.py
Verified signature4021bf3 -
Update app.py
Verified signaturef6f7832 -
Update app.py
Verified signatureb90251f -
Update app.py
Verified signature7e4a06b -
Update app.py
Verified signature335f9f4 -
Update app.py
Verified signature31243f4 -
Update app.py
Verified signaturee80aab9 -
Update app.py
Verified signaturefa7d846 -
Update app.py
Verified signaturee101d07 -
Update app.py
Verified signaturee326bf0
-
Update app.py
Verified signaturedb2d57b -
Update app.py
Verified signatureeccf8e4 -
Update app.py
Verified signatureb5c6c62 -
Update app.py
Verified signatureba7497e -
Create app.py
Verified signature10e9b7d