Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ def predict(text):
|
|
| 12 |
input_ids = tokenizer(text, max_length=156, return_tensors="pt", padding="max_length", truncation=True).input_ids.to(device)
|
| 13 |
outputs = model.generate(input_ids=input_ids, max_new_tokens=528, do_sample=True)
|
| 14 |
pred = tokenizer.batch_decode(outputs.detach().cpu().numpy(), skip_special_tokens=True)[0]
|
| 15 |
-
return pred
|
| 16 |
|
| 17 |
title = 'VTA-QA Demo'
|
| 18 |
article = "Loaded model from https://huggingface.co/kietnt0603/randeng-t5-vta-qa-lora"
|
|
|
|
| 12 |
input_ids = tokenizer(text, max_length=156, return_tensors="pt", padding="max_length", truncation=True).input_ids.to(device)
|
| 13 |
outputs = model.generate(input_ids=input_ids, max_new_tokens=528, do_sample=True)
|
| 14 |
pred = tokenizer.batch_decode(outputs.detach().cpu().numpy(), skip_special_tokens=True)[0]
|
| 15 |
+
return pred[len('<extra_id_0>'):]
|
| 16 |
|
| 17 |
title = 'VTA-QA Demo'
|
| 18 |
article = "Loaded model from https://huggingface.co/kietnt0603/randeng-t5-vta-qa-lora"
|