Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -80,7 +80,7 @@ def create_error_image(message):
|
|
80 |
|
81 |
def classify_prompt(prompt):
|
82 |
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=512)
|
83 |
-
|
84 |
outputs = model(**inputs)
|
85 |
return torch.argmax(outputs.logits).item()
|
86 |
|
@@ -310,17 +310,17 @@ with gr.Blocks(
|
|
310 |
generate_btn = gr.Button("Generate", variant="primary")
|
311 |
status_output = gr.Textbox(label="status", interactive=False, lines=4)
|
312 |
gr.Examples(
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
[
|
317 |
"https://d2g64w682n9w0w.cloudfront.net/media/ec44bbf6abac4c25998dd2c4af1a46a7/images/1747413751234102420_md9ywspl.png",
|
318 |
"https://d2g64w682n9w0w.cloudfront.net/media/ec44bbf6abac4c25998dd2c4af1a46a7/images/1747413586520964413_7bkgc9ol.png"
|
319 |
]
|
320 |
-
|
321 |
],
|
322 |
-
|
323 |
-
|
324 |
|
325 |
random_seed_btn.click(
|
326 |
fn=lambda: random.randint(0, 999999),
|
|
|
80 |
|
81 |
def classify_prompt(prompt):
|
82 |
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=512)
|
83 |
+
with torch.no_grad():
|
84 |
outputs = model(**inputs)
|
85 |
return torch.argmax(outputs.logits).item()
|
86 |
|
|
|
310 |
generate_btn = gr.Button("Generate", variant="primary")
|
311 |
status_output = gr.Textbox(label="status", interactive=False, lines=4)
|
312 |
gr.Examples(
|
313 |
+
examples=[
|
314 |
+
[
|
315 |
+
"The elegant lady carefully selects bags in the boutique, and she shows the charm of a mature woman in a black slim dress with a pearl necklace, as well as her pretty face. Holding a vintage-inspired blue leather half-moon handbag, she is carefully observing its craftsmanship and texture. The interior of the store is a haven of sophistication and luxury. Soft, ambient lighting casts a warm glow over the polished wooden floors",
|
316 |
[
|
317 |
"https://d2g64w682n9w0w.cloudfront.net/media/ec44bbf6abac4c25998dd2c4af1a46a7/images/1747413751234102420_md9ywspl.png",
|
318 |
"https://d2g64w682n9w0w.cloudfront.net/media/ec44bbf6abac4c25998dd2c4af1a46a7/images/1747413586520964413_7bkgc9ol.png"
|
319 |
]
|
320 |
+
]
|
321 |
],
|
322 |
+
inputs=[prompt, images],
|
323 |
+
)
|
324 |
|
325 |
random_seed_btn.click(
|
326 |
fn=lambda: random.randint(0, 999999),
|