Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,12 +93,13 @@ def infer(prompt,
|
|
| 93 |
"early_stopping":early_stopping,
|
| 94 |
"no_repeat_ngram_size":no_repeat_ngram_size,
|
| 95 |
"num_beams":num_beams,
|
| 96 |
-
"return_full_text":return_full_text
|
|
|
|
| 97 |
}
|
| 98 |
|
| 99 |
s = time.time()
|
| 100 |
response = inference(prompt, params=params)
|
| 101 |
-
|
| 102 |
proc_time = time.time()-s
|
| 103 |
#print(f"Processing time was {proc_time} seconds")
|
| 104 |
return response
|
|
@@ -166,11 +167,11 @@ with gr.Blocks() as demo:
|
|
| 166 |
"""Enter a prompt and get the tee shirt design. Use examples as a guide. We use an equally powerful AI model bigscience/bloom."""
|
| 167 |
)
|
| 168 |
with gr.Row() as row:
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
|
| 175 |
|
| 176 |
btn.click(getadvertisement,inputs=[textbox], outputs=[output_image])
|
|
|
|
| 93 |
"early_stopping":early_stopping,
|
| 94 |
"no_repeat_ngram_size":no_repeat_ngram_size,
|
| 95 |
"num_beams":num_beams,
|
| 96 |
+
"return_full_text":return_full_text,
|
| 97 |
+
"raw_response":True
|
| 98 |
}
|
| 99 |
|
| 100 |
s = time.time()
|
| 101 |
response = inference(prompt, params=params)
|
| 102 |
+
print(response)
|
| 103 |
proc_time = time.time()-s
|
| 104 |
#print(f"Processing time was {proc_time} seconds")
|
| 105 |
return response
|
|
|
|
| 167 |
"""Enter a prompt and get the tee shirt design. Use examples as a guide. We use an equally powerful AI model bigscience/bloom."""
|
| 168 |
)
|
| 169 |
with gr.Row() as row:
|
| 170 |
+
with gr.Column():
|
| 171 |
+
textbox = gr.Textbox(placeholder="Enter prompt...", lines=1,label='Your prompt')
|
| 172 |
+
btn = gr.Button("Generate")
|
| 173 |
+
with gr.Column():
|
| 174 |
+
output_image = gr.components.Image(label="Your tee shirt")
|
| 175 |
|
| 176 |
|
| 177 |
btn.click(getadvertisement,inputs=[textbox], outputs=[output_image])
|