Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -282,15 +282,15 @@ else:
|
|
| 282 |
# Load speech-to-text model (Whisper)
|
| 283 |
speech_to_text = pipeline("automatic-speech-recognition", model="openai/whisper-tiny")
|
| 284 |
|
| 285 |
-
#
|
| 286 |
-
# text_to_image = StableDiffusionPipeline.from_pretrained(
|
| 287 |
-
# "runwayml/stable-diffusion-v1-5",revision="fp16"
|
| 288 |
-
# )
|
| 289 |
text_to_image = StableDiffusionPipeline.from_pretrained(
|
| 290 |
-
"runwayml/stable-diffusion-v1-5",
|
| 291 |
-
cache_dir="./my_model_cache", # Custom cache directory
|
| 292 |
-
revision="fp16"
|
| 293 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
|
| 295 |
device = "cuda" if torch.cuda.is_available() else "cpu" # This will now work since torch is imported
|
| 296 |
text_to_image.to(device)
|
|
|
|
| 282 |
# Load speech-to-text model (Whisper)
|
| 283 |
speech_to_text = pipeline("automatic-speech-recognition", model="openai/whisper-tiny")
|
| 284 |
|
| 285 |
+
#Load Stable Diffusion model for text-to-image
|
|
|
|
|
|
|
|
|
|
| 286 |
text_to_image = StableDiffusionPipeline.from_pretrained(
|
| 287 |
+
"runwayml/stable-diffusion-v1-5",revision="fp16"
|
|
|
|
|
|
|
| 288 |
)
|
| 289 |
+
# text_to_image = StableDiffusionPipeline.from_pretrained(
|
| 290 |
+
# "runwayml/stable-diffusion-v1-5",
|
| 291 |
+
# cache_dir="./my_model_cache", # Custom cache directory
|
| 292 |
+
# revision="fp16"
|
| 293 |
+
# )
|
| 294 |
|
| 295 |
device = "cuda" if torch.cuda.is_available() else "cpu" # This will now work since torch is imported
|
| 296 |
text_to_image.to(device)
|