Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -13,14 +13,23 @@ def classify_image_with_text(text, image):
|
|
13 |
return {label: score for label, score in zip(labels, scores)}
|
14 |
|
15 |
# Créer l'interface Gradio
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
# Lancer l'interface
|
26 |
iface.launch()
|
|
|
13 |
return {label: score for label, score in zip(labels, scores)}
|
14 |
|
15 |
# Créer l'interface Gradio
|
16 |
+
with gr.Blocks(title="SD Models") as my_interface:
|
17 |
+
with gr.Column(scale=12):
|
18 |
+
with gr.Row():
|
19 |
+
with gr.Row(scale=6):
|
20 |
+
primary_prompt = gr.Textbox(label="Prompt", value="")
|
21 |
+
input_image = gr.Image(label="Image")
|
22 |
+
|
23 |
+
with gr.Row(scale=6):
|
24 |
+
with gr.Row():
|
25 |
+
api = gr.Button("Api", variant="primary")
|
26 |
+
with gr.Row():
|
27 |
+
api_image_output = gr.Textbox(label='Api OutPut')
|
28 |
+
|
29 |
+
|
30 |
+
api.click(classify_image_with_text, inputs=[primary_prompt,input_image], outputs=[api_image_output], api_name='generate')
|
31 |
+
|
32 |
+
|
33 |
|
34 |
# Lancer l'interface
|
35 |
iface.launch()
|