Spaces:
Runtime error
Runtime error
Saosri Ghosal
commited on
Commit
·
ca917a8
1
Parent(s):
c5d67ba
added changes
Browse files- app.py +9 -11
- requirements.txt +4 -2
app.py
CHANGED
|
@@ -1,10 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
|
| 4 |
-
# PATCH diffusers for custom pipeline loading
|
| 5 |
-
from diffusers.utils import import_utils
|
| 6 |
-
import_utils._import_structure["custom_diffusers"] = []
|
| 7 |
-
|
| 8 |
from diffusers import DiffusionPipeline
|
| 9 |
|
| 10 |
MODEL_ID = "PYY2001/BizGen"
|
|
@@ -16,12 +12,14 @@ pipe = DiffusionPipeline.from_pretrained(
|
|
| 16 |
pipe.to("cpu")
|
| 17 |
|
| 18 |
def generate(prompt):
|
| 19 |
-
|
| 20 |
-
return
|
| 21 |
|
| 22 |
-
gr.Interface(
|
| 23 |
fn=generate,
|
| 24 |
-
inputs=gr.Textbox(
|
| 25 |
-
outputs=gr.Image(
|
| 26 |
-
title="BizGen Image Generator"
|
| 27 |
-
)
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
from diffusers import DiffusionPipeline
|
| 5 |
|
| 6 |
MODEL_ID = "PYY2001/BizGen"
|
|
|
|
| 12 |
pipe.to("cpu")
|
| 13 |
|
| 14 |
def generate(prompt):
|
| 15 |
+
out = pipe(prompt).images[0]
|
| 16 |
+
return out
|
| 17 |
|
| 18 |
+
demo = gr.Interface(
|
| 19 |
fn=generate,
|
| 20 |
+
inputs=gr.Textbox(label="Prompt"),
|
| 21 |
+
outputs=gr.Image(),
|
| 22 |
+
title="BizGen Image Generator"
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
demo.launch()
|
requirements.txt
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
| 1 |
diffusers==0.27.2
|
| 2 |
transformers==4.41.2
|
| 3 |
-
accelerate==0.31.0
|
| 4 |
huggingface_hub==0.33.1
|
| 5 |
-
|
| 6 |
sentencepiece
|
| 7 |
Pillow
|
| 8 |
gradio==4.44.0
|
|
|
|
| 1 |
+
torch==2.4.0
|
| 2 |
+
torchvision==0.19.0
|
| 3 |
+
numpy<2
|
| 4 |
diffusers==0.27.2
|
| 5 |
transformers==4.41.2
|
|
|
|
| 6 |
huggingface_hub==0.33.1
|
| 7 |
+
accelerate>=0.31.0
|
| 8 |
sentencepiece
|
| 9 |
Pillow
|
| 10 |
gradio==4.44.0
|