Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -18,7 +18,7 @@ def explain_text(text):
|
|
| 18 |
tokenizer = AutoTokenizer.from_pretrained("gpt2")
|
| 19 |
|
| 20 |
# Encode the text and convert to PyTorch tensors
|
| 21 |
-
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=512)
|
| 22 |
|
| 23 |
input_ids = inputs["input_ids"]
|
| 24 |
attention_mask = inputs["attention_mask"]
|
|
|
|
| 18 |
tokenizer = AutoTokenizer.from_pretrained("gpt2")
|
| 19 |
|
| 20 |
# Encode the text and convert to PyTorch tensors
|
| 21 |
+
inputs = tokenizer([text], return_tensors="pt", padding=True, truncation=True, max_length=512)
|
| 22 |
|
| 23 |
input_ids = inputs["input_ids"]
|
| 24 |
attention_mask = inputs["attention_mask"]
|