Ruslan Magana Vsevolodovna commited on
Commit
16a94a1
β€’
1 Parent(s): 9e7dce3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -18,12 +18,16 @@ from os import getcwd
18
  import glob
19
  import nltk
20
  nltk.download('punkt')
21
- device = "cuda:0" if torch.cuda.is_available() else "cpu"
22
  description = " Video Story Generator with Audio \n PS: Generation of video by using Artifical Intellingence by dalle-mini and distilbart and gtss "
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,
@@ -50,8 +54,8 @@ def get_output_video(text):
50
  models_root=models_root,
51
  is_reusable=False,
52
  is_verbose=True,
53
- #dtype=torch.float16 if fp16 else torch.float32
54
- dtype=torch.float32
55
  )
56
 
57
  image = model.generate_image(
 
18
  import glob
19
  import nltk
20
  nltk.download('punkt')
 
21
  description = " Video Story Generator with Audio \n PS: Generation of video by using Artifical Intellingence by dalle-mini and distilbart and gtss "
22
  title = "Video Story Generator with Audio by using dalle-mini and distilbart and gtss "
23
  tokenizer = AutoTokenizer.from_pretrained("sshleifer/distilbart-cnn-12-6")
24
  model = AutoModelForSeq2SeqLM.from_pretrained("sshleifer/distilbart-cnn-12-6")
25
+
26
+ #device = "cuda:0" if torch.cuda.is_available() else "cpu"
27
+ device = torch.device('cuda')
28
+ # transfer model
29
+ model.to(device)
30
+
31
  def get_output_video(text):
32
  inputs = tokenizer(text,
33
  max_length=1024,
 
54
  models_root=models_root,
55
  is_reusable=False,
56
  is_verbose=True,
57
+ dtype=torch.float16 if fp16 else torch.float32
58
+ #dtype=torch.float32
59
  )
60
 
61
  image = model.generate_image(