Update app.py
Browse files
app.py
CHANGED
@@ -54,7 +54,7 @@ def summarize(video_id):
|
|
54 |
inputs = tokenizer(texts, return_tensors="pt", padding=True, )
|
55 |
|
56 |
with torch.no_grad():
|
57 |
-
output_tokens = model.generate(input_ids=inputs["input_ids"].to(
|
58 |
outputs = tokenizer.batch_decode(output_tokens.detach().cpu().numpy(), skip_special_tokens=True)
|
59 |
|
60 |
return outputs
|
|
|
54 |
inputs = tokenizer(texts, return_tensors="pt", padding=True, )
|
55 |
|
56 |
with torch.no_grad():
|
57 |
+
output_tokens = model.generate(input_ids=inputs["input_ids"].to(device), max_new_tokens=60, do_sample=True, top_p=0.9)
|
58 |
outputs = tokenizer.batch_decode(output_tokens.detach().cpu().numpy(), skip_special_tokens=True)
|
59 |
|
60 |
return outputs
|