Spaces:
Runtime error
Runtime error
vasudevgupta
commited on
Commit
•
4f0d358
1
Parent(s):
8f330dd
Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,10 @@ text_model.to(device).eval()
|
|
30 |
autoencoder.to(device).eval()
|
31 |
|
32 |
def generate_image(text_query):
|
33 |
-
|
|
|
|
|
|
|
|
|
34 |
|
35 |
gr.Interface(fn=generate_image, inputs="text", outputs="image").launch()
|
|
|
30 |
autoencoder.to(device).eval()
|
31 |
|
32 |
def generate_image(text_query):
|
33 |
+
array = generate_image_from_text(text_query, text_tokenizer, text_model, autoencoder, biggan, device=device)
|
34 |
+
array = ((array + 1.0) / 2.0) * 256
|
35 |
+
array.clip(0, 255, out=array)
|
36 |
+
array = np.asarray(np.uint8(array), dtype=np.uint8)
|
37 |
+
return array
|
38 |
|
39 |
gr.Interface(fn=generate_image, inputs="text", outputs="image").launch()
|