DanCip commited on
Commit
dcb7053
·
1 Parent(s): bb5127a

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -41,7 +41,7 @@ project = hopsworks.login()
41
  fs = project.get_feature_store()
42
 
43
  mr = project.get_model_registry()
44
- model = mr.get_model("salary_model", version=4)
45
  model_dir = model.download()
46
  model = joblib.load(model_dir + "/model.pkl")
47
  print("Model downloaded")
@@ -181,13 +181,13 @@ demo = gr.Interface(
181
  description="Prediction of the salary in USD",
182
  allow_flagging="never",
183
  inputs=[
184
- gr.components.Number(label='Work Year', bind='work_year'),
185
- gr.components.Select(label='Experience Level', options=['EN', 'MI', 'SE', 'EX'], bind='experience_level'),
186
- gr.components.Select(label='Company Size', options=['S', 'M', 'L'], bind='company_size'),
187
- gr.components.Select(label='Currency', options=['EUR', 'GBP', 'USD'], bind='currency'),
188
- gr.components.Select(label='Job Title', options=job_title_options, bind='job_title'),
189
- gr.components.TextInput(label='Country (3 letter code)', bind='country')
190
  ],
191
  outputs=gr.Text())
192
 
193
- demo.launch(debug=True)
 
41
  fs = project.get_feature_store()
42
 
43
  mr = project.get_model_registry()
44
+ model = mr.get_model("salary_model", version=5)
45
  model_dir = model.download()
46
  model = joblib.load(model_dir + "/model.pkl")
47
  print("Model downloaded")
 
181
  description="Prediction of the salary in USD",
182
  allow_flagging="never",
183
  inputs=[
184
+ gr.components.Number(label='work_year'),
185
+ gr.components.Select(label='experience_level', options=['EN', 'MI', 'SE', 'EX']),
186
+ gr.components.Select(label='company_size', options=['S', 'M', 'L']),
187
+ gr.components.Select(label='currency', options=['EUR', 'GBP', 'USD']),
188
+ gr.components.Select(label='job_title', options=job_title_options),
189
+ gr.components.TextInput(label='country')
190
  ],
191
  outputs=gr.Text())
192
 
193
+ demo.launch(debug=True)