Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ def extract_text(image):
|
|
| 14 |
def explain_text(text):
|
| 15 |
input_ids = text_tokenizer.encode(text, return_tensors="pt")
|
| 16 |
explanation_ids = text_generator.generate(input_ids, max_length=100, num_return_sequences=1)
|
| 17 |
-
explanation = text_tokenizer.decode(explanation_ids[
|
| 18 |
return explanation
|
| 19 |
|
| 20 |
st.title("Text Classification Model")
|
|
|
|
| 14 |
def explain_text(text):
|
| 15 |
input_ids = text_tokenizer.encode(text, return_tensors="pt")
|
| 16 |
explanation_ids = text_generator.generate(input_ids, max_length=100, num_return_sequences=1)
|
| 17 |
+
explanation = text_tokenizer.decode(explanation_ids[0], skip_special_tokens=True)
|
| 18 |
return explanation
|
| 19 |
|
| 20 |
st.title("Text Classification Model")
|