Spaces:
Runtime error
Runtime error
add provider together
Browse files23 unmodified lines242526272827282930313226 unmodified lines596061616262636465666768697071727323 unmodified lines def __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") 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" out = self.llm.text_generation(prompt, max_new_tokens=64, temperature=0) return out.strip()
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