Spaces:
Sleeping
Sleeping
Switch to text_generation — model not registered as chat model
Browse files86 unmodified lines8788899091929394959697989910010110286 unmodified linesuser_message = build_prompt(req)try:response = client.chat_completion(messages=[{"role": "system", "content": SYSTEM_PROMPT},{"role": "user", "content": user_message},],max_tokens=256,temperature=0.1,)raw = response.choices[0].message.contentexcept Exception as e:raise HTTPException(status_code=500, detail=f"Model inference failed: {str(e)}")86 unmodified lines8788899091929394959697989910010186 unmodified linesuser_message = build_prompt(req)prompt = f"<|system|>\n{SYSTEM_PROMPT}\n<|user|>\n{user_message}\n<|assistant|>\n"try:raw = client.text_generation(prompt,max_new_tokens=256,temperature=0.1,stop_sequences=["<|user|>", "<|system|>"],)except Exception as e:raise HTTPException(status_code=500, detail=f"Model inference failed: {str(e)}")
app.py+6-7