Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,6 +63,7 @@ def run_tinystyler_batch(source_texts, target_texts_batch, reranking, temperatur
|
|
| 63 |
)
|
| 64 |
print("Log 2", time(), output.shape)
|
| 65 |
generated_texts = tokenizer.batch_decode(output, skip_special_tokens=True)
|
|
|
|
| 66 |
|
| 67 |
# Evaluate candidates
|
| 68 |
candidates_luar_embeddings = [get_luar_embeddings([[candidates[i]] for candidates in generated_texts]) for i in range(reranking)]
|
|
|
|
| 63 |
)
|
| 64 |
print("Log 2", time(), output.shape)
|
| 65 |
generated_texts = tokenizer.batch_decode(output, skip_special_tokens=True)
|
| 66 |
+
generated_texts = [generated_texts[i * reranking:(i + 1) * reranking] for i in range(inputs["input_ids"].shape[0])] # Unflatten
|
| 67 |
|
| 68 |
# Evaluate candidates
|
| 69 |
candidates_luar_embeddings = [get_luar_embeddings([[candidates[i]] for candidates in generated_texts]) for i in range(reranking)]
|