Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,8 +5,9 @@ import gradio as gr
|
|
| 5 |
from PIL import Image
|
| 6 |
from pypdf import PdfReader
|
| 7 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, tool
|
|
|
|
| 8 |
|
| 9 |
-
# ১. মডেল সেটআপ
|
| 10 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 11 |
model = InferenceClientModel(
|
| 12 |
model_id="Qwen/Qwen2.5-Coder-1.5B-Instruct",
|
|
@@ -53,6 +54,8 @@ gaia_agent = CodeAgent(
|
|
| 53 |
|
| 54 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 55 |
|
|
|
|
|
|
|
| 56 |
def solve_single_task(question: str, file_path: str = None) -> str:
|
| 57 |
prompt = f"Question: {question}\n"
|
| 58 |
if file_path:
|
|
|
|
| 5 |
from PIL import Image
|
| 6 |
from pypdf import PdfReader
|
| 7 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, tool
|
| 8 |
+
import spaces
|
| 9 |
|
| 10 |
+
# ১. মডেল সেটআপ
|
| 11 |
HF_TOKEN = os.getenv("HF_TOKEN")
|
| 12 |
model = InferenceClientModel(
|
| 13 |
model_id="Qwen/Qwen2.5-Coder-1.5B-Instruct",
|
|
|
|
| 54 |
|
| 55 |
DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
| 56 |
|
| 57 |
+
# ZeroGPU রিকোয়ারমেন্ট মেটাতে @spaces.GPU যুক্ত করা হলো
|
| 58 |
+
@spaces.GPU
|
| 59 |
def solve_single_task(question: str, file_path: str = None) -> str:
|
| 60 |
prompt = f"Question: {question}\n"
|
| 61 |
if file_path:
|