martenb commited on
Commit
11f1456
·
1 Parent(s): bf7ef22

Updated app at lör 11 nov 2023 16:18:44 CET

Browse files
Files changed (2) hide show
  1. app.py +20 -7
  2. requirements.txt +0 -3
app.py CHANGED
@@ -53,18 +53,31 @@ model = joblib.load(model_dir + "/iris_model.pkl")
53
  print("Gradio version:", gr.__version__)
54
 
55
  print("Configuring gradio interface...")
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  demo = gr.Interface(
57
  fn=iris,
58
  title="Iris Flower Predictive Analytics",
59
  description="Experiment with sepal/petal lengths/widths to predict which flower it is.",
60
- allow_flagging="never",
61
  inputs=[
62
- gr.inputs.Number(default=2.0, label="sepal length (cm)"),
63
- gr.inputs.Number(default=1.0, label="sepal width (cm)"),
64
- gr.inputs.Number(default=2.0, label="petal length (cm)"),
65
- gr.inputs.Number(default=1.0, label="petal width (cm)"),
66
  ],
67
- outputs=gr.Image(type="pil"))
 
68
 
69
  print("Launching gradio...")
70
  demo.launch(debug=True)
@@ -87,4 +100,4 @@ Traceback (most recent call last):
87
  File "/home/user/app/app.py", line 62, in <module>
88
  gr.inputs.Number(default=2.0, label="sepal length (cm)"),
89
  AttributeError: module 'gradio' has no attribute 'inputs
90
- """
 
53
  print("Gradio version:", gr.__version__)
54
 
55
  print("Configuring gradio interface...")
56
+ # demo = gr.Interface(
57
+ # fn=iris,
58
+ # title="Iris Flower Predictive Analytics",
59
+ # description="Experiment with sepal/petal lengths/widths to predict which flower it is.",
60
+ # allow_flagging="never",
61
+ # inputs=[
62
+ # gr.inputs.Number(default=2.0, label="sepal length (cm)"),
63
+ # gr.inputs.Number(default=1.0, label="sepal width (cm)"),
64
+ # gr.inputs.Number(default=2.0, label="petal length (cm)"),
65
+ # gr.inputs.Number(default=1.0, label="petal width (cm)"),
66
+ # ],
67
+ # outputs=gr.Image(type="pil"))
68
+
69
  demo = gr.Interface(
70
  fn=iris,
71
  title="Iris Flower Predictive Analytics",
72
  description="Experiment with sepal/petal lengths/widths to predict which flower it is.",
 
73
  inputs=[
74
+ gr.Number(label="sepal length (cm)", value=2.0),
75
+ gr.Number(label="sepal width (cm)", value=1.0),
76
+ gr.Number(label="petal length (cm)", value=2.0),
77
+ gr.Number(label="petal width (cm)", value=1.0)
78
  ],
79
+ outputs=gr.Image(type="pil"),
80
+ )
81
 
82
  print("Launching gradio...")
83
  demo.launch(debug=True)
 
100
  File "/home/user/app/app.py", line 62, in <module>
101
  gr.inputs.Number(default=2.0, label="sepal length (cm)"),
102
  AttributeError: module 'gradio' has no attribute 'inputs
103
+ """
requirements.txt CHANGED
@@ -1,6 +1,3 @@
1
  hopsworks
2
  joblib
3
  scikit-learn==1.1.1
4
- gradio==3.14.0
5
- pandas
6
- requests
 
1
  hopsworks
2
  joblib
3
  scikit-learn==1.1.1