aahmed10202 commited on
Commit
1f70acc
·
verified ·
1 Parent(s): c69e636

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -15,7 +15,11 @@ if email_content:
15
  prompt = f"Generate a professional email reply to the following email: {email_content}"
16
 
17
  # Generate the reply using the model
18
- generated_reply = pipe(prompt)
19
-
20
  # Display the generated reply
21
- st.write(generated_reply[0]['generated_text'])
 
 
 
 
 
15
  prompt = f"Generate a professional email reply to the following email: {email_content}"
16
 
17
  # Generate the reply using the model
18
+ generated_reply = pipe(prompt, max_length=200, num_return_sequences=1)
19
+
20
  # Display the generated reply
21
+ if generated_reply:
22
+ # Show only the generated text
23
+ st.write(generated_reply[0]['generated_text'].strip())
24
+ else:
25
+ st.write("Sorry, the model could not generate a reply.")