Update app.py
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
|
| 11 |
def generate_questions(email):
|
| 12 |
"""Generates questions based on the input email."""
|
| 13 |
# ... (existing code for encoding the email)
|
| 14 |
-
|
| 15 |
# Check length instead of shape
|
| 16 |
if len(inputs["input_ids"]) > 512: # Adjust maximum sequence length as needed
|
| 17 |
print("WARNING: Input sequence exceeds maximum length. Truncating.")
|
|
|
|
| 11 |
def generate_questions(email):
|
| 12 |
"""Generates questions based on the input email."""
|
| 13 |
# ... (existing code for encoding the email)
|
| 14 |
+
inputs = tokenizer(email, return_tensors="pt")
|
| 15 |
# Check length instead of shape
|
| 16 |
if len(inputs["input_ids"]) > 512: # Adjust maximum sequence length as needed
|
| 17 |
print("WARNING: Input sequence exceeds maximum length. Truncating.")
|