Ruslan Magana Vsevolodovna
commited on
Commit
·
2efab13
1
Parent(s):
f4abe5f
Update app.py
Browse files
app.py
CHANGED
@@ -23,6 +23,7 @@ description = " Video Story Generator with Audio \n PS: Generation of video by
|
|
23 |
title = "Video Story Generator with Audio by using dalle-mini and distilbart and gtss "
|
24 |
tokenizer = AutoTokenizer.from_pretrained("sshleifer/distilbart-cnn-12-6")
|
25 |
model = AutoModelForSeq2SeqLM.from_pretrained("sshleifer/distilbart-cnn-12-6")
|
|
|
26 |
def get_output_video(text):
|
27 |
inputs = tokenizer(text,
|
28 |
max_length=1024,
|
@@ -32,7 +33,7 @@ def get_output_video(text):
|
|
32 |
summary_ids = model.generate(inputs["input_ids"])
|
33 |
summary = tokenizer.batch_decode(summary_ids,
|
34 |
skip_special_tokens=True,
|
35 |
-
clean_up_tokenization_spaces=False)
|
36 |
plot = list(summary[0].split('.'))
|
37 |
|
38 |
def generate_image(
|
|
|
23 |
title = "Video Story Generator with Audio by using dalle-mini and distilbart and gtss "
|
24 |
tokenizer = AutoTokenizer.from_pretrained("sshleifer/distilbart-cnn-12-6")
|
25 |
model = AutoModelForSeq2SeqLM.from_pretrained("sshleifer/distilbart-cnn-12-6")
|
26 |
+
model = model.to(device)
|
27 |
def get_output_video(text):
|
28 |
inputs = tokenizer(text,
|
29 |
max_length=1024,
|
|
|
33 |
summary_ids = model.generate(inputs["input_ids"])
|
34 |
summary = tokenizer.batch_decode(summary_ids,
|
35 |
skip_special_tokens=True,
|
36 |
+
clean_up_tokenization_spaces=False).to(device)
|
37 |
plot = list(summary[0].split('.'))
|
38 |
|
39 |
def generate_image(
|