Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -81,10 +81,10 @@ os.makedirs(app.config['MODEL_FOLDER'], exist_ok=True)
|
|
| 81 |
# Prediction analysis models loaded from Hugging Face.
|
| 82 |
src_path = hf_hub_download(
|
| 83 |
repo_id="WebashalarForML/Diamond_model_",
|
| 84 |
-
filename="models_list/mkble/
|
| 85 |
cache_dir=MODEL_FOLDER
|
| 86 |
)
|
| 87 |
-
dst_path = os.path.join(MODEL_FOLDER, "
|
| 88 |
shutil.copy(src_path, dst_path)
|
| 89 |
makable_model = load(dst_path)
|
| 90 |
|
|
@@ -265,7 +265,7 @@ def process_dataframe(df):
|
|
| 265 |
|
| 266 |
# Create two DataFrames: one for prediction and one for classification.
|
| 267 |
df_pred = df[required_columns].copy()
|
| 268 |
-
df_pred = df_pred[(df_pred[['EngCts']] >
|
| 269 |
df_pred[['EngBlk', 'EngWht', 'EngOpen', 'EngPav']]=df_pred[['EngBlk', 'EngWht', 'EngOpen', 'EngPav']].fillna("NA")
|
| 270 |
df_class = df[required_columns_2].fillna("NA").copy()
|
| 271 |
|
|
|
|
| 81 |
# Prediction analysis models loaded from Hugging Face.
|
| 82 |
src_path = hf_hub_download(
|
| 83 |
repo_id="WebashalarForML/Diamond_model_",
|
| 84 |
+
filename="models_list/mkble/DecisionTree_best_pipeline_mkble_1_to_1.49.pkl",
|
| 85 |
cache_dir=MODEL_FOLDER
|
| 86 |
)
|
| 87 |
+
dst_path = os.path.join(MODEL_FOLDER, "DecisionTree_best_pipeline_mkble_1_to_1.49.pkl")
|
| 88 |
shutil.copy(src_path, dst_path)
|
| 89 |
makable_model = load(dst_path)
|
| 90 |
|
|
|
|
| 265 |
|
| 266 |
# Create two DataFrames: one for prediction and one for classification.
|
| 267 |
df_pred = df[required_columns].copy()
|
| 268 |
+
df_pred = df_pred[(df_pred[['EngCts']] > 1.00).all(axis=1) & (df_pred[['EngCts']] <= 1.49).all(axis=1)]
|
| 269 |
df_pred[['EngBlk', 'EngWht', 'EngOpen', 'EngPav']]=df_pred[['EngBlk', 'EngWht', 'EngOpen', 'EngPav']].fillna("NA")
|
| 270 |
df_class = df[required_columns_2].fillna("NA").copy()
|
| 271 |
|