Amol Kaushik commited on
Commit
42a4f47
·
1 Parent(s): 9457a9d

Fix app.py paths, ignore pkl files for CI/CD compatibility

Browse files
Files changed (4) hide show
  1. .gitignore +11 -0
  2. A3/A3_Report.ipynb +20 -20
  3. A3/app.py +1 -1
  4. app.py +7 -4
.gitignore ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Model files - upload manually to HuggingFace Spaces via web UI
2
+ # HuggingFace rejects binary files via git push
3
+ A3/models/*.pkl
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[cod]
8
+ .ipynb_checkpoints/
9
+
10
+ # OS
11
+ .DS_Store
A3/A3_Report.ipynb CHANGED
@@ -47,7 +47,7 @@
47
  },
48
  {
49
  "cell_type": "code",
50
- "execution_count": 21,
51
  "id": "edbe3fbd",
52
  "metadata": {},
53
  "outputs": [],
@@ -77,7 +77,7 @@
77
  },
78
  {
79
  "cell_type": "code",
80
- "execution_count": 22,
81
  "id": "23f1b38b",
82
  "metadata": {},
83
  "outputs": [
@@ -128,7 +128,7 @@
128
  },
129
  {
130
  "cell_type": "code",
131
- "execution_count": 23,
132
  "id": "080ab472",
133
  "metadata": {},
134
  "outputs": [
@@ -200,7 +200,7 @@
200
  },
201
  {
202
  "cell_type": "code",
203
- "execution_count": 24,
204
  "id": "438e27ae",
205
  "metadata": {},
206
  "outputs": [
@@ -298,7 +298,7 @@
298
  },
299
  {
300
  "cell_type": "code",
301
- "execution_count": 25,
302
  "id": "7560ae66",
303
  "metadata": {},
304
  "outputs": [
@@ -335,7 +335,7 @@
335
  },
336
  {
337
  "cell_type": "code",
338
- "execution_count": 26,
339
  "id": "9f17a88e",
340
  "metadata": {},
341
  "outputs": [
@@ -381,7 +381,7 @@
381
  },
382
  {
383
  "cell_type": "code",
384
- "execution_count": 27,
385
  "id": "d4c02996",
386
  "metadata": {},
387
  "outputs": [],
@@ -404,7 +404,7 @@
404
  },
405
  {
406
  "cell_type": "code",
407
- "execution_count": 28,
408
  "id": "c8292b2b",
409
  "metadata": {},
410
  "outputs": [],
@@ -442,7 +442,7 @@
442
  },
443
  {
444
  "cell_type": "code",
445
- "execution_count": 29,
446
  "id": "b598aef7",
447
  "metadata": {},
448
  "outputs": [
@@ -475,7 +475,7 @@
475
  },
476
  {
477
  "cell_type": "code",
478
- "execution_count": 30,
479
  "id": "962743cc",
480
  "metadata": {},
481
  "outputs": [
@@ -603,7 +603,7 @@
603
  },
604
  {
605
  "cell_type": "code",
606
- "execution_count": 31,
607
  "id": "5c9efd5b",
608
  "metadata": {},
609
  "outputs": [
@@ -636,7 +636,7 @@
636
  },
637
  {
638
  "cell_type": "code",
639
- "execution_count": 32,
640
  "id": "ce01a75f",
641
  "metadata": {},
642
  "outputs": [
@@ -814,7 +814,7 @@
814
  },
815
  {
816
  "cell_type": "code",
817
- "execution_count": 33,
818
  "id": "3e5e5e9b",
819
  "metadata": {},
820
  "outputs": [
@@ -849,7 +849,7 @@
849
  },
850
  {
851
  "cell_type": "code",
852
- "execution_count": 34,
853
  "id": "4de69063",
854
  "metadata": {},
855
  "outputs": [
@@ -885,7 +885,7 @@
885
  },
886
  {
887
  "cell_type": "code",
888
- "execution_count": 35,
889
  "id": "a994b1af",
890
  "metadata": {},
891
  "outputs": [
@@ -1035,7 +1035,7 @@
1035
  },
1036
  {
1037
  "cell_type": "code",
1038
- "execution_count": 36,
1039
  "id": "00f3eda4",
1040
  "metadata": {},
1041
  "outputs": [
@@ -1067,7 +1067,7 @@
1067
  },
1068
  {
1069
  "cell_type": "code",
1070
- "execution_count": 37,
1071
  "id": "6b03902f",
1072
  "metadata": {},
1073
  "outputs": [
@@ -1262,7 +1262,7 @@
1262
  },
1263
  {
1264
  "cell_type": "code",
1265
- "execution_count": 38,
1266
  "id": "0b3e066a",
1267
  "metadata": {},
1268
  "outputs": [
@@ -1398,7 +1398,7 @@
1398
  },
1399
  {
1400
  "cell_type": "code",
1401
- "execution_count": 39,
1402
  "id": "d21c037d",
1403
  "metadata": {},
1404
  "outputs": [
@@ -1476,7 +1476,7 @@
1476
  },
1477
  {
1478
  "cell_type": "code",
1479
- "execution_count": 40,
1480
  "id": "4f01e27a",
1481
  "metadata": {},
1482
  "outputs": [
 
47
  },
48
  {
49
  "cell_type": "code",
50
+ "execution_count": 61,
51
  "id": "edbe3fbd",
52
  "metadata": {},
53
  "outputs": [],
 
77
  },
78
  {
79
  "cell_type": "code",
80
+ "execution_count": 62,
81
  "id": "23f1b38b",
82
  "metadata": {},
83
  "outputs": [
 
128
  },
129
  {
130
  "cell_type": "code",
131
+ "execution_count": 63,
132
  "id": "080ab472",
133
  "metadata": {},
134
  "outputs": [
 
200
  },
201
  {
202
  "cell_type": "code",
203
+ "execution_count": 64,
204
  "id": "438e27ae",
205
  "metadata": {},
206
  "outputs": [
 
298
  },
299
  {
300
  "cell_type": "code",
301
+ "execution_count": 65,
302
  "id": "7560ae66",
303
  "metadata": {},
304
  "outputs": [
 
335
  },
336
  {
337
  "cell_type": "code",
338
+ "execution_count": 66,
339
  "id": "9f17a88e",
340
  "metadata": {},
341
  "outputs": [
 
381
  },
382
  {
383
  "cell_type": "code",
384
+ "execution_count": 67,
385
  "id": "d4c02996",
386
  "metadata": {},
387
  "outputs": [],
 
404
  },
405
  {
406
  "cell_type": "code",
407
+ "execution_count": 68,
408
  "id": "c8292b2b",
409
  "metadata": {},
410
  "outputs": [],
 
442
  },
443
  {
444
  "cell_type": "code",
445
+ "execution_count": 69,
446
  "id": "b598aef7",
447
  "metadata": {},
448
  "outputs": [
 
475
  },
476
  {
477
  "cell_type": "code",
478
+ "execution_count": 70,
479
  "id": "962743cc",
480
  "metadata": {},
481
  "outputs": [
 
603
  },
604
  {
605
  "cell_type": "code",
606
+ "execution_count": 71,
607
  "id": "5c9efd5b",
608
  "metadata": {},
609
  "outputs": [
 
636
  },
637
  {
638
  "cell_type": "code",
639
+ "execution_count": 72,
640
  "id": "ce01a75f",
641
  "metadata": {},
642
  "outputs": [
 
814
  },
815
  {
816
  "cell_type": "code",
817
+ "execution_count": 73,
818
  "id": "3e5e5e9b",
819
  "metadata": {},
820
  "outputs": [
 
849
  },
850
  {
851
  "cell_type": "code",
852
+ "execution_count": 74,
853
  "id": "4de69063",
854
  "metadata": {},
855
  "outputs": [
 
885
  },
886
  {
887
  "cell_type": "code",
888
+ "execution_count": 75,
889
  "id": "a994b1af",
890
  "metadata": {},
891
  "outputs": [
 
1035
  },
1036
  {
1037
  "cell_type": "code",
1038
+ "execution_count": 76,
1039
  "id": "00f3eda4",
1040
  "metadata": {},
1041
  "outputs": [
 
1067
  },
1068
  {
1069
  "cell_type": "code",
1070
+ "execution_count": 77,
1071
  "id": "6b03902f",
1072
  "metadata": {},
1073
  "outputs": [
 
1262
  },
1263
  {
1264
  "cell_type": "code",
1265
+ "execution_count": 78,
1266
  "id": "0b3e066a",
1267
  "metadata": {},
1268
  "outputs": [
 
1398
  },
1399
  {
1400
  "cell_type": "code",
1401
+ "execution_count": 79,
1402
  "id": "d21c037d",
1403
  "metadata": {},
1404
  "outputs": [
 
1476
  },
1477
  {
1478
  "cell_type": "code",
1479
+ "execution_count": 80,
1480
  "id": "4f01e27a",
1481
  "metadata": {},
1482
  "outputs": [
A3/app.py CHANGED
@@ -7,7 +7,7 @@ import os
7
  SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
8
 
9
  MODEL_PATH = os.path.join(SCRIPT_DIR, "models/champion_model_final_2.pkl")
10
- CLASSIFICATION_MODEL_PATH = os.path.join(SCRIPT_DIR, "models/classification_champion.pkl")
11
  DATA_PATH = os.path.join(SCRIPT_DIR, "A3_Data/train_dataset.csv")
12
 
13
  model = None
 
7
  SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
8
 
9
  MODEL_PATH = os.path.join(SCRIPT_DIR, "models/champion_model_final_2.pkl")
10
+ CLASSIFICATION_MODEL_PATH = os.path.join(SCRIPT_DIR, "models/final_champion_model_A3.pkl")
11
  DATA_PATH = os.path.join(SCRIPT_DIR, "A3_Data/train_dataset.csv")
12
 
13
  model = None
app.py CHANGED
@@ -3,10 +3,13 @@ import pandas as pd
3
  import pickle
4
  import os
5
 
6
- # Paths for HuggingFace deployment (runs from repository root)
7
- MODEL_PATH = "A3/models/champion_model_final_2.pkl"
8
- CLASSIFICATION_MODEL_PATH = "A3/models/classification_champion.pkl"
9
- DATA_PATH = "A3/A3_Data/train_dataset.csv"
 
 
 
10
 
11
  model = None
12
  FEATURE_NAMES = None
 
3
  import pickle
4
  import os
5
 
6
+ # Get directory where this script is located
7
+ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
8
+
9
+ # Local paths - models loaded from A3/models/ directory
10
+ MODEL_PATH = os.path.join(SCRIPT_DIR, "A3/models/champion_model_final_2.pkl")
11
+ CLASSIFICATION_MODEL_PATH = os.path.join(SCRIPT_DIR, "A3/models/final_champion_model_A3.pkl")
12
+ DATA_PATH = os.path.join(SCRIPT_DIR, "A3/A3_Data/train_dataset.csv")
13
 
14
  model = None
15
  FEATURE_NAMES = None