Spaces:
Sleeping
Sleeping
Update app.py
Browse files49 unmodified lines5051525353545556575859606061626349 unmodified lines if self.cfg["provider"] == "hf": try: # Try text-generation first out = self.client.text_generation( out = self.hf.text_generation( model=model, prompt=prompt, max_new_tokens=128, temperature=0.2 ) return out.strip() except Exception as e: # If the backend says “Supported task: conversational”, retry with chat if "supported task: conversational" in str(e).lower(): chat = self.client.chat_completion( chat = self.hf.chat_completion( model=model, messages=[{"role": "user", "content": prompt}], max_tokens=128,app.py+2-2