Spaces:
Runtime error
Runtime error
add provider together
Browse files23 unmodified lines242526272829303126 unmodified lines585960616263646523 unmodified linesdef __init__(self):print("BasicAgent initialized.")model_id = os.getenv("HF_API_URL", "Qwen/Qwen2.5-7B-Instruct")token = os.getenv("HF_TOKEN") or os.getenv("HUGGINGFACEHUB_API_TOKEN")self.llm = InferenceClient(model=model_id, token=token, provider="hf-inference")def _maybe_fetch_file(self, task_id: str):try:26 unmodified lines)if context:prompt += f"\nContext:\n{context}\n"out = self.llm.text_generation(prompt, max_new_tokens=64, temperature=0)return out.strip()def __call__(self, question: str) -> str:a = self._try_math(question)23 unmodified lines24252627282930313226 unmodified lines59606162636465666768697071727323 unmodified linesdef __init__(self):print("BasicAgent initialized.")model_id = os.getenv("HF_API_URL", "Qwen/Qwen2.5-7B-Instruct")token = os.getenv("HF_TOKEN")api_key = os.getenv("TOGETHER_API_KEY")self.llm = InferenceClient(model=model_id, token=api_key, provider="together")def _maybe_fetch_file(self, task_id: str):try:26 unmodified lines)if context:prompt += f"\nContext:\n{context}\n"resp = self.llm.chat_completion(messages=[{"role": "user", "content": prompt}],max_tokens=64,temperature=0,)text = resp.choices[0].message["content"]return _clean(text)def __call__(self, question: str) -> str:a = self._try_math(question)
app.py+12-4