Saad0KH commited on
Commit
373c79f
·
verified ·
1 Parent(s): 35ceb6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -8
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
- iface = gr.Interface(
17
- fn=classify_image_with_text,
18
- inputs=[
19
- gr.inputs.Textbox(lines=5, label="Texte"),
20
- gr.inputs.Image(label="Image")
21
- ],
22
- outputs=gr.outputs.Label(num_top_classes=3) # Ajustez le nombre de classes principales si nécessaire
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()