whispy commited on
Commit
0194f0f
1 Parent(s): f528573

Upload 3 files

Browse files
Files changed (1) hide show
  1. app.py +2 -7
app.py CHANGED
@@ -1,16 +1,12 @@
1
  import torch
2
-
3
  import gradio as gr
4
  import pytube as pt
5
  from transformers import pipeline
6
  from diffusers import StableDiffusionPipeline
7
 
8
 
9
-
10
  MODEL_NAME = "whispy/whisper_italian"
11
 
12
- device = 0 if torch.cuda.is_available() else "cpu"
13
-
14
  summarizer = pipeline(
15
  "summarization",
16
  model="it5/it5-efficient-small-el32-news-summarization",
@@ -20,13 +16,12 @@ pipe = pipeline(
20
  task="automatic-speech-recognition",
21
  model=MODEL_NAME,
22
  chunk_length_s=30,
23
- device=device,
24
  )
25
 
26
  YOUR_TOKEN="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"
27
  image_pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16, use_auth_token=YOUR_TOKEN)
28
-
29
- image_pipe.to("cuda")
30
 
31
  translator = pipeline("translation", model="Helsinki-NLP/opus-mt-it-en")
32
 
 
1
  import torch
 
2
  import gradio as gr
3
  import pytube as pt
4
  from transformers import pipeline
5
  from diffusers import StableDiffusionPipeline
6
 
7
 
 
8
  MODEL_NAME = "whispy/whisper_italian"
9
 
 
 
10
  summarizer = pipeline(
11
  "summarization",
12
  model="it5/it5-efficient-small-el32-news-summarization",
 
16
  task="automatic-speech-recognition",
17
  model=MODEL_NAME,
18
  chunk_length_s=30,
19
+ device="cpu",
20
  )
21
 
22
  YOUR_TOKEN="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"
23
  image_pipe = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", revision="fp16", torch_dtype=torch.float16, use_auth_token=YOUR_TOKEN)
24
+ image_pipe.to("cpu")
 
25
 
26
  translator = pipeline("translation", model="Helsinki-NLP/opus-mt-it-en")
27