Spaces:
Sleeping
Sleeping
Update app.py
Browse files24 unmodified lines25262728282930311 unmodified line3334353636373839394041414243434445464724 unmodified lines if not message: return PlainTextResponse("Пустое сообщение")
prompt = f"Respond politely and friendly to this message: {message}" prompt = f"Reply politely to this message: {message}"
inputs = tokenizer(prompt, return_tensors="pt")
1 unmodified line outputs = model.generate( **inputs, max_new_tokens=60, temperature=0.7 do_sample=False )
reply = tokenizer.decode(outputs[0], skip_special_tokens=True) reply = tokenizer.decode(outputs[0], skip_special_tokens=True).strip()
if not reply: reply = "I am doing well! How can I help you?"
return PlainTextResponse(reply)
except Exception as e: return PlainTextResponse(f"ERROR: {str(e)}")app.py+6-5