Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import time
|
| 2 |
import torch
|
| 3 |
-
|
| 4 |
from PIL import Image
|
| 5 |
from tqdm import tqdm
|
| 6 |
from threading import Thread
|
|
@@ -71,7 +71,7 @@ vqllm = vqllm.eval()
|
|
| 71 |
|
| 72 |
num_codebooks = vae_cfg.num_codebooks
|
| 73 |
|
| 74 |
-
|
| 75 |
def bot_streaming_I2T(message, history):
|
| 76 |
print(message)
|
| 77 |
global stop_flag
|
|
@@ -149,7 +149,7 @@ def show_gallery(images):
|
|
| 149 |
gallery = gr.Gallery(images, label="Gallery", columns=4, height="auto",preview=True,scale=0.05) # 设置两行两列的布局
|
| 150 |
return gallery
|
| 151 |
|
| 152 |
-
|
| 153 |
def bot_streaming_T2I(message, history,guidance_scale, temperature, top_K, top_P):
|
| 154 |
global stop_flag
|
| 155 |
stop_flag = True
|
|
@@ -269,7 +269,6 @@ with gr.Blocks(fill_height=True) as demo:
|
|
| 269 |
aaa = gr.ChatInterface(
|
| 270 |
fn=bot_streaming_T2I,
|
| 271 |
examples=[
|
| 272 |
-
["Magic mushroom in the forest", 5.0, 1.0, 2048, 1.0],
|
| 273 |
["cherry tree on the surface of the moon", 5.0, 1.0, 2048, 1.0],
|
| 274 |
["New York City at night with starry night vincent van gogh style", 5.0, 1.0, 2048, 1.0],
|
| 275 |
["cavalier king charles spaniel being cute and ultra realistic with cute sunglasses", 5.0, 1.0, 2048, 1.0],
|
|
|
|
| 1 |
import time
|
| 2 |
import torch
|
| 3 |
+
import spaces
|
| 4 |
from PIL import Image
|
| 5 |
from tqdm import tqdm
|
| 6 |
from threading import Thread
|
|
|
|
| 71 |
|
| 72 |
num_codebooks = vae_cfg.num_codebooks
|
| 73 |
|
| 74 |
+
@spaces.GPU
|
| 75 |
def bot_streaming_I2T(message, history):
|
| 76 |
print(message)
|
| 77 |
global stop_flag
|
|
|
|
| 149 |
gallery = gr.Gallery(images, label="Gallery", columns=4, height="auto",preview=True,scale=0.05) # 设置两行两列的布局
|
| 150 |
return gallery
|
| 151 |
|
| 152 |
+
@spaces.GPU
|
| 153 |
def bot_streaming_T2I(message, history,guidance_scale, temperature, top_K, top_P):
|
| 154 |
global stop_flag
|
| 155 |
stop_flag = True
|
|
|
|
| 269 |
aaa = gr.ChatInterface(
|
| 270 |
fn=bot_streaming_T2I,
|
| 271 |
examples=[
|
|
|
|
| 272 |
["cherry tree on the surface of the moon", 5.0, 1.0, 2048, 1.0],
|
| 273 |
["New York City at night with starry night vincent van gogh style", 5.0, 1.0, 2048, 1.0],
|
| 274 |
["cavalier king charles spaniel being cute and ultra realistic with cute sunglasses", 5.0, 1.0, 2048, 1.0],
|