Spaces:
Sleeping
Sleeping
adjusted tensor shape
Browse files
app.py
CHANGED
|
@@ -66,7 +66,7 @@ if __name__ == "__main__":
|
|
| 66 |
if model.config.is_encoder_decoder:
|
| 67 |
highlighted_out = []
|
| 68 |
else:
|
| 69 |
-
input_tokens = tokenizer.convert_ids_to_tokens(inputs.input_ids)
|
| 70 |
highlighted_out = [(token.replace("▁", " "), None) for token in input_tokens]
|
| 71 |
# Get the (decoded_token, label) pairs for the generated tokens
|
| 72 |
for token, proba in zip(generated_tokens, transition_proba[0]):
|
|
|
|
| 66 |
if model.config.is_encoder_decoder:
|
| 67 |
highlighted_out = []
|
| 68 |
else:
|
| 69 |
+
input_tokens = tokenizer.convert_ids_to_tokens(inputs.input_ids[0])
|
| 70 |
highlighted_out = [(token.replace("▁", " "), None) for token in input_tokens]
|
| 71 |
# Get the (decoded_token, label) pairs for the generated tokens
|
| 72 |
for token, proba in zip(generated_tokens, transition_proba[0]):
|