Spaces:
Running
on
Zero
Running
on
Zero
Jiaming Han
commited on
Commit
·
86b170a
1
Parent(s):
87f9ab9
init
Browse files
app.py
CHANGED
@@ -39,7 +39,7 @@ config.encoder_path = hf_hub_download("csuhan/TA-Tok", "ta_tok.pth")
|
|
39 |
config.decoder_path = hf_hub_download("peizesun/llamagen_t2i", "vq_ds16_t2i.pt")
|
40 |
inference = TextToImageInference(config)
|
41 |
|
42 |
-
@spaces.GPU(duration=
|
43 |
def generate_image(prompt, resolution, top_p, top_k, cfg_scale):
|
44 |
image = inference.generate_image(prompt, resolution, top_p, top_k, cfg_scale)
|
45 |
return image
|
@@ -47,7 +47,7 @@ def generate_image(prompt, resolution, top_p, top_k, cfg_scale):
|
|
47 |
def clear_inputs_t2i():
|
48 |
return "", None
|
49 |
|
50 |
-
@spaces.GPU(duration=
|
51 |
def understand_image(image, prompt):
|
52 |
return generate_text(inference, image, prompt)
|
53 |
|
|
|
39 |
config.decoder_path = hf_hub_download("peizesun/llamagen_t2i", "vq_ds16_t2i.pt")
|
40 |
inference = TextToImageInference(config)
|
41 |
|
42 |
+
@spaces.GPU(duration=120)
|
43 |
def generate_image(prompt, resolution, top_p, top_k, cfg_scale):
|
44 |
image = inference.generate_image(prompt, resolution, top_p, top_k, cfg_scale)
|
45 |
return image
|
|
|
47 |
def clear_inputs_t2i():
|
48 |
return "", None
|
49 |
|
50 |
+
@spaces.GPU(duration=120)
|
51 |
def understand_image(image, prompt):
|
52 |
return generate_text(inference, image, prompt)
|
53 |
|