JuanjoRosquete commited on
Commit
4471392
1 Parent(s): c493409

Add application file

Browse files
Files changed (1) hide show
  1. app.py +11 -12
app.py CHANGED
@@ -2,16 +2,15 @@
2
  # -*- coding: utf-8 -*-
3
  import os
4
 
5
- print("Installing correct gradio version...")
6
- os.system("pip uninstall -y gradio")
7
- os.system("pip install tf-keras")
8
- os.system("pip install diffusers")
9
- os.system("pip install accelerate")
10
- os.system("pip install transformers")
11
- os.system("pip install numpy")
12
- os.system("pip install torch")
13
- os.system("pip install gradio==3.50.0")
14
- os.system("pip install --upgrade pip")
15
 
16
  print("Installing Finished!")
17
 
@@ -27,8 +26,8 @@ from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler
27
  model_id = "stabilityai/stable-diffusion-2"
28
 
29
  scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
30
- image_model = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16)
31
- image_model = image_model.to("cuda")
32
 
33
  model = pipeline("automatic-speech-recognition","facebook/wav2vec2-large-xlsr-53-spanish")
34
 
 
2
  # -*- coding: utf-8 -*-
3
  import os
4
 
5
+ print("Installing...")
6
+ os.system("!pip install gradio")
7
+ os.system("!pip install tf-keras")
8
+ os.system("!pip install diffusers")
9
+ os.system("!pip install accelerate")
10
+ os.system("!pip install transformers")
11
+ os.system("!pip install numpy")
12
+ os.system("!pip install torch")
13
+ #os.system("pip install --upgrade pip")
 
14
 
15
  print("Installing Finished!")
16
 
 
26
  model_id = "stabilityai/stable-diffusion-2"
27
 
28
  scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler")
29
+ image_model = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float32)
30
+ image_model = image_model.to("cpu")
31
 
32
  model = pipeline("automatic-speech-recognition","facebook/wav2vec2-large-xlsr-53-spanish")
33