Spaces:
Sleeping
Sleeping
bipin
commited on
Commit
•
93a1261
1
Parent(s):
d001ee1
Update : Model trained, dumped compressed pickel
Browse files- .gitignore +3 -0
- pklCompressor.py +17 -0
- pklUnCompressor.py +17 -0
- pyvenv.cfg +5 -0
- script.ipynb +0 -0
.gitignore
CHANGED
@@ -18,6 +18,8 @@ lib/
|
|
18 |
lib64/
|
19 |
parts/
|
20 |
sdist/
|
|
|
|
|
21 |
var/
|
22 |
wheels/
|
23 |
share/python-wheels/
|
@@ -31,6 +33,7 @@ MANIFEST
|
|
31 |
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
32 |
*.manifest
|
33 |
*.spec
|
|
|
34 |
|
35 |
# Installer logs
|
36 |
pip-log.txt
|
|
|
18 |
lib64/
|
19 |
parts/
|
20 |
sdist/
|
21 |
+
Scripts/
|
22 |
+
share/
|
23 |
var/
|
24 |
wheels/
|
25 |
share/python-wheels/
|
|
|
33 |
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
34 |
*.manifest
|
35 |
*.spec
|
36 |
+
*.pkl
|
37 |
|
38 |
# Installer logs
|
39 |
pip-log.txt
|
pklCompressor.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gzip
|
2 |
+
import pickle
|
3 |
+
|
4 |
+
def compress_pickle(input_file, output_file):
|
5 |
+
# Open the pickle file for reading
|
6 |
+
with open(input_file, 'rb') as f:
|
7 |
+
data = pickle.load(f)
|
8 |
+
|
9 |
+
# Compress the data and save it
|
10 |
+
with gzip.open(output_file, 'wb') as f:
|
11 |
+
pickle.dump(data, f)
|
12 |
+
|
13 |
+
# Example usage
|
14 |
+
input_pickle_file = 'forest.pkl'
|
15 |
+
output_compressed_pickle_file = 'compressed_forest.pkl.gz'
|
16 |
+
|
17 |
+
compress_pickle(input_pickle_file, output_compressed_pickle_file)
|
pklUnCompressor.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gzip
|
2 |
+
import pickle
|
3 |
+
|
4 |
+
def decompress_pickle(input_compressed_file, output_file):
|
5 |
+
# Open the compressed pickle file for reading
|
6 |
+
with gzip.open(input_compressed_file, 'rb') as f:
|
7 |
+
data = pickle.load(f)
|
8 |
+
|
9 |
+
# Save the uncompressed data into a pickle file
|
10 |
+
with open(output_file, 'wb') as f:
|
11 |
+
pickle.dump(data, f)
|
12 |
+
|
13 |
+
# Example usage
|
14 |
+
input_compressed_pickle_file = 'compressed_forest.pkl.gz'
|
15 |
+
output_pickle_file = 'uncompressed_forest.pkl'
|
16 |
+
|
17 |
+
decompress_pickle(input_compressed_pickle_file, output_pickle_file)
|
pyvenv.cfg
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
home = C:\Users\HP\anaconda3
|
2 |
+
include-system-site-packages = false
|
3 |
+
version = 3.11.5
|
4 |
+
executable = C:\Users\HP\anaconda3\python.exe
|
5 |
+
command = C:\Users\HP\anaconda3\python.exe -m venv C:\Users\HP\Desktop\e2edeployment
|
script.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|