| from transformers import pipeline |
|
|
| |
| pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-R1", trust_remote_code=True) |
|
|
| |
| def generate_reply(email_content): |
| messages = [ |
| {"role": "user", "content": f"Generate a professional email reply to the following email: {email_content}"} |
| ] |
| |
| reply = pipe(messages) |
| return reply[0]['generated_text'] |
|
|
| |
| user_email = "Dear team, I hope this email finds you well. Could you provide an update on the project status?" |
| generated_reply = generate_reply(user_email) |
| print(f"Generated Reply: {generated_reply}") |
|
|