Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,20 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
-
interface = gr.Interface.load("huggingface/pranavpsv/gpt2-genre-story-generator",
|
| 8 |
-
# description=description,
|
| 9 |
-
# examples=examples
|
| 10 |
-
)
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import numpy as np
|
| 3 |
+
import time
|
| 4 |
|
| 5 |
+
def fake_diffusion(steps):
|
| 6 |
+
rng = np.random.default_rng()
|
| 7 |
+
for i in range(steps):
|
| 8 |
+
time.sleep(1)
|
| 9 |
+
image = rng.random(size=(600, 600, 3))
|
| 10 |
+
yield image
|
| 11 |
+
image = np.ones((1000,1000,3), np.uint8)
|
| 12 |
+
image[:] = [255, 124, 0]
|
| 13 |
+
yield image
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
demo = gr.Interface(fake_diffusion,
|
| 17 |
+
inputs=gr.Slider(1, 10, 3, step=1),
|
| 18 |
+
outputs="image").queue()
|
| 19 |
+
|
| 20 |
+
demo.launch()
|