Sahithi27 commited on
Commit
45d00a3
·
verified ·
1 Parent(s): 9c2e23d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -9,6 +9,9 @@ import os
9
  # ---------------------------------------------------------
10
  ARTIFACT_PATH = "dynamic_pricing_artifact.joblib"
11
 
 
 
 
12
  artifact = joblib.load(ARTIFACT_PATH)
13
  model = artifact["model"]
14
  FEATURES = artifact["features"]
@@ -109,4 +112,3 @@ demo = gr.Interface(
109
  )
110
 
111
  demo.launch()
112
-
 
9
  # ---------------------------------------------------------
10
  ARTIFACT_PATH = "dynamic_pricing_artifact.joblib"
11
 
12
+ if not os.path.exists(ARTIFACT_PATH):
13
+ raise FileNotFoundError("Upload dynamic_pricing_artifact.joblib to your Space!")
14
+
15
  artifact = joblib.load(ARTIFACT_PATH)
16
  model = artifact["model"]
17
  FEATURES = artifact["features"]
 
112
  )
113
 
114
  demo.launch()