ajinkyakolhe112 commited on
Commit
f3c98f0
·
verified ·
1 Parent(s): a86055e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -8
app.py CHANGED
@@ -26,22 +26,30 @@ def classify_image(image_filepath):
26
 
27
  import gradio as gr
28
 
29
- def welcome(model_details):
30
- return f"Your model details are: {model_details}"
31
 
32
  with gr.Blocks(title="Image Classification for 1000 Objects", css=".gradio-container {background:#FFD1DC;}") as demo:
33
  gr.HTML("""<div style="font-family:'Calibri', 'Serif'; font-size:16pt; font-weight:bold; text-align:center; color:black;">Image Classification for 1000 Objects</div>""")
34
 
35
  gr.Markdown(
36
  """
37
- # Welcome to Image Classification Demo
38
- Start typing below to see the output.
 
39
  """
40
  )
41
-
42
- inp_model_details = gr.Textbox(placeholder="Enter model details")
43
- out = gr.Textbox()
44
- inp_model_details.change( inp_model_details, welcome, out)
 
 
 
 
 
 
 
45
 
46
 
47
  with gr.Row():
 
26
 
27
  import gradio as gr
28
 
29
+ def display_model_details(model_details):
30
+ return f"**Model Details:**\n\n{model_details}"
31
 
32
  with gr.Blocks(title="Image Classification for 1000 Objects", css=".gradio-container {background:#FFD1DC;}") as demo:
33
  gr.HTML("""<div style="font-family:'Calibri', 'Serif'; font-size:16pt; font-weight:bold; text-align:center; color:black;">Image Classification for 1000 Objects</div>""")
34
 
35
  gr.Markdown(
36
  """
37
+ # Enter Model Details
38
+
39
+ Please provide the necessary information about your model in the text box below.
40
  """
41
  )
42
+ input_box = gr.Textbox(placeholder="Enter model details")
43
+ output_box = gr.Markdown()
44
+
45
+ input_box.change(display_model_details, input_box, output_box)
46
+
47
+ gr.Interface(
48
+ fn=display_model_details,
49
+ inputs="text",
50
+ outputs="text",
51
+ title="Model Details"
52
+ ).launch()
53
 
54
 
55
  with gr.Row():