Spaces:
Sleeping
Sleeping
Update app.py
Browse files24 unmodified lines252627282930316 unmodified lines383940414243444546474824 unmodified linesif not message:return PlainTextResponse("Пустое сообщение")prompt = f"You are a friendly AI assistant.\nUser: {message}\nAssistant:"inputs = tokenizer(prompt, return_tensors="pt")6 unmodified linesreply = tokenizer.decode(outputs[0], skip_special_tokens=True)# Убираем лишнееif "Assistant:" in reply:reply = reply.split("Assistant:")[-1].strip()return PlainTextResponse(reply)except Exception as e:return PlainTextResponse(f"ERROR: {str(e)}")24 unmodified lines252627282930316 unmodified lines38394041424344454624 unmodified linesif not message:return PlainTextResponse("Пустое сообщение")prompt = f"Respond politely and friendly to this message: {message}"inputs = tokenizer(prompt, return_tensors="pt")6 unmodified linesreply = tokenizer.decode(outputs[0], skip_special_tokens=True)except Exception as e:return PlainTextResponse(f"ERROR: {str(e)}")
app.py+3-5