Spaces:
Build error
Build error
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.")
|