Spaces:
Runtime error
Runtime error
Commit ·
272a723
1
Parent(s): f91f7d6
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
import torch
|
| 3 |
from transformers import pipeline
|
| 4 |
from diffusers import StableDiffusionPipeline
|
|
@@ -25,6 +26,7 @@ else:
|
|
| 25 |
title = "Txt to Image by CPU"
|
| 26 |
pipeline = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=token)
|
| 27 |
|
|
|
|
| 28 |
|
| 29 |
def predict(prompt):
|
| 30 |
predictions = pipeline(prompt, guidance_scale=7.5).images[0]
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
import torch
|
| 4 |
from transformers import pipeline
|
| 5 |
from diffusers import StableDiffusionPipeline
|
|
|
|
| 26 |
title = "Txt to Image by CPU"
|
| 27 |
pipeline = StableDiffusionPipeline.from_pretrained(model_id, use_auth_token=token)
|
| 28 |
|
| 29 |
+
title = os.environ['model_fetch']
|
| 30 |
|
| 31 |
def predict(prompt):
|
| 32 |
predictions = pipeline(prompt, guidance_scale=7.5).images[0]
|