Spaces:
Sleeping
Sleeping
Update app.py
Browse files24 unmodified lines252627282930311 unmodified line333435363738394041424344454624 unmodified linesif not message:return PlainTextResponse("Пустое сообщение")prompt = f"Respond politely and friendly to this message: {message}"inputs = tokenizer(prompt, return_tensors="pt")1 unmodified lineoutputs = model.generate(**inputs,max_new_tokens=60,temperature=0.7)reply = tokenizer.decode(outputs[0], skip_special_tokens=True)except Exception as e:return PlainTextResponse(f"ERROR: {str(e)}")24 unmodified lines252627282930311 unmodified line33343536373839404142434445464724 unmodified linesif not message:return PlainTextResponse("Пустое сообщение")prompt = f"Reply politely to this message: {message}"inputs = tokenizer(prompt, return_tensors="pt")1 unmodified lineoutputs = model.generate(**inputs,max_new_tokens=60,do_sample=False)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