Spaces:
Runtime error
Runtime error
add provider hf-inference
Browse files24 unmodified lines2526272829303127 unmodified lines5960616263646524 unmodified linesprint("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)def _maybe_fetch_file(self, task_id: str):try:27 unmodified linesif context:prompt += f"\nContext:\n{context}\n"out = self.llm.text_generation(prompt, max_new_tokens=64, temperature=0)return _clean(out)def __call__(self, question: str) -> str:a = self._try_math(question)24 unmodified lines2526272829303127 unmodified lines5960616263646524 unmodified linesprint("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:27 unmodified linesif 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)
app.py+2-2