Spaces:
Sleeping
Sleeping
Update app.py
Browse files4 unmodified lines5678910115 unmodified lines1718192021222324211 unmodified lines2362372382392402412424 unmodified linesimport inspectimport pandas as pdimport toolsfrom smolagents import CodeAgent, HfApiModelfrom typing import TypedDict, List, Dict, Any, Optionalfrom langgraph.graph import StateGraph, START, ENDfrom langgraph.messages import HumanMessage5 unmodified lines# --- Models ---# Vision model for image analysis / OCRvision_model = HfApiModel(repo_id="FireRedTeam/FireRed-OCR", max_new_tokens=2048, temperature=0.3)math_model = HfApiModel(repo_id="Qwen/Qwen2.5-Math-1.5B", max_new_tokens=2048, temperature=0.3)#define the stateclass AgentState(TypedDict):211 unmodified lines"""messages = [HumanMessage(content=prompt)]# Use the general model for final answer synthesisgeneral_model = HfApiModel(repo_id="Qwen3.5-35B-A3B", max_new_tokens=2048, temperature=0.3)response = general_model.invoke(messages)raw_response = response.content if hasattr(response, 'content') else str(response)4 unmodified lines5678910115 unmodified lines1718192021222324211 unmodified lines2362372382392402412424 unmodified linesimport inspectimport pandas as pdimport toolsfrom smolagents import CodeAgent, ApiModelfrom typing import TypedDict, List, Dict, Any, Optionalfrom langgraph.graph import StateGraph, START, ENDfrom langgraph.messages import HumanMessage5 unmodified lines# --- Models ---# Vision model for image analysis / OCRvision_model = ApiModel(repo_id="FireRedTeam/FireRed-OCR", max_new_tokens=2048, temperature=0.3)math_model = ApiModel(repo_id="Qwen/Qwen2.5-Math-1.5B", max_new_tokens=2048, temperature=0.3)#define the stateclass AgentState(TypedDict):211 unmodified lines"""messages = [HumanMessage(content=prompt)]# Use the general model for final answer synthesisgeneral_model = ApiModel(repo_id="Qwen3.5-35B-A3B", max_new_tokens=2048, temperature=0.3)response = general_model.invoke(messages)raw_response = response.content if hasattr(response, 'content') else str(response)
app.py+4-4