ReplyCraft / app.py
aahmed10202's picture
Create app.py
5a6efbf verified
raw
history blame
727 Bytes
from transformers import pipeline
# Use a pipeline as a high-level helper
pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-R1", trust_remote_code=True)
# Function to generate a reply based on user's input email content
def generate_reply(email_content):
messages = [
{"role": "user", "content": f"Generate a professional email reply to the following email: {email_content}"}
]
# Get the reply from the model
reply = pipe(messages)
return reply[0]['generated_text']
# Example usage
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}")