mmathys commited on
Commit
f6bcba8
·
1 Parent(s): 7e086e3
Files changed (1) hide show
  1. app.py +38 -1
app.py CHANGED
@@ -1,7 +1,44 @@
 
1
  import gradio as gr
2
 
3
  def greet(name):
4
  return "Hello " + name + "!!"
5
 
6
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #%%
2
  import gradio as gr
3
 
4
  def greet(name):
5
  return "Hello " + name + "!!"
6
 
7
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
8
+ iface.launch()
9
+ # %%
10
+ import gradio as gr
11
+
12
+
13
+ def sentence_builder(model, dataset):
14
+ return f"Model card for {model} and {dataset}."
15
+
16
+
17
+ demo = gr.Interface(
18
+ sentence_builder,
19
+ [
20
+ gr.Dropdown(
21
+ ["microsoft/resnet-34", "microsoft/resnet-50"], label="Model", info="Select a model to use for testing."
22
+ ),
23
+ gr.Dropdown(
24
+ ["marmal88/skin_cancer"], label="Dataset", info="Select the sampling dataset to use for testing."
25
+ ),
26
+ #gr.CheckboxGroup(["USA", "Japan", "Pakistan"], label="Countries", info="Where are they from?"),
27
+ #gr.Radio(["park", "zoo", "road"], label="Location", info="Where did they go?"),
28
+ #gr.Dropdown(
29
+ # ["ran", "swam", "ate", "slept"], value=["swam", "slept"], multiselect=True, label="Activity", info="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed auctor, nisl eget ultricies aliquam, nunc nisl aliquet nunc, eget aliquam nisl nunc vel nisl."
30
+ #),
31
+ #gr.Checkbox(label="Morning", info="Did they do it in the morning?"),
32
+ ],
33
+ gr.Label(num_top_classes=4),
34
+ examples=[
35
+ ["microsoft/resnet-34", "marmal88/skin_cancer"],
36
+ #[2, "cat", ["Japan", "Pakistan"], "park", ["ate", "swam"], True],
37
+ #[4, "dog", ["Japan"], "zoo", ["ate", "swam"], False],
38
+ #[10, "bird", ["USA", "Pakistan"], "road", ["ran"], False],
39
+ #[8, "cat", ["Pakistan"], "zoo", ["ate"], True],
40
+ ]
41
+ )
42
+
43
+ if __name__ == "__main__":
44
+ demo.launch()