Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Melodic
morphemic-preprocessor
Commits
267bb13f
Commit
267bb13f
authored
Nov 25, 2021
by
Diana Jlailaty
Browse files
fixing FileNotFound error
parent
43f8ebe4
Pipeline
#17651
passed with stage
in 1 minute and 29 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
forecasting_gluonts/docker_image/run_gluonts.sh
View file @
267bb13f
...
...
@@ -2,8 +2,7 @@
sudo
docker rmi
-f
$(
sudo
docker images
)
# Build the image from dockerfile and clone the latest version of my code
sudo
docker build
.
-t
gitlab.ow2.org:4567/melodic/morphemic-preprocessor/gluonmachines:morphemic-rc1.5
docker build
-t
gitlab.ow2.org:4567/melodic/morphemic-preprocessor/gluonmachines:morphemic-rc1.5
-f
./forecasting_gluonts/docker_image/Dockerfile
.
# Test the image
#sudo docker run -it --env-file variables.env gitlab.ow2.org:4567/melodic/morphemic-preprocessor/gluonmachines:morphemic-rc1.5
...
...
forecasting_gluonts/gluonts_forecaster.py
View file @
267bb13f
...
...
@@ -39,7 +39,11 @@ directory_path = "/morphemic_project/"
def
train
(
metric
):
data_file_path
=
os
.
path
.
join
(
os
.
environ
.
get
(
"DATA_PATH"
,
"./"
),
f
'
{
os
.
environ
.
get
(
"APP_NAME"
,
"demo"
)
}
.csv'
)
#while (not os.path.isfile(data_file_path)):
#sleep(30)
#logging.debug("Waiting for dataset to be loaded")
dataset
=
pd
.
read_csv
(
data_file_path
)
gluonts_dataset
=
pd
.
DataFrame
(
columns
=
[
'ds'
,
'y'
])
...
...
forecasting_gluonts/gluonts_listener.py
View file @
267bb13f
...
...
@@ -40,6 +40,10 @@ def worker(self,body,metric):
epoch_start
=
body
[
"epoch_start"
]
predictionTimes
[
metric
]
=
epoch_start
while
(
not
os
.
path
.
isfile
(
directory_path
+
'models/gluonts_'
+
metric
+
".pkl"
)):
sleep
(
30
)
logging
.
debug
(
"Waiting for the trained model for metric: "
+
metric
)
while
(
True
):
#if flags[metric] == 0:
#epoch_start = predictionTimes[metric]
...
...
@@ -134,6 +138,10 @@ class Gluonts(morphemic.handler.ModelHandler,messaging.listener.MorphemicListene
def
on_metrics_to_predict
(
self
,
body
):
dataset_preprocessor
=
CSVData
(
APP_NAME
)
dataset_preprocessor
.
prepare_csv
()
data_file_path
=
os
.
path
.
join
(
os
.
environ
.
get
(
"DATA_PATH"
,
"./"
),
f
'
{
os
.
environ
.
get
(
"APP_NAME"
,
"demo"
)
}
.csv'
)
while
(
not
os
.
path
.
isfile
(
data_file_path
)):
sleep
(
30
)
logging
.
debug
(
"Waiting for dataset to be loaded"
)
logging
.
debug
(
"DATASET DOWNLOADED"
)
for
r
in
body
:
...
...
forecasting_prophet/docker_image/run_prophet.sh
View file @
267bb13f
...
...
@@ -2,7 +2,8 @@
sudo
docker rmi
-f
$(
sudo
docker images
)
# Build the image from dockerfile and clone the latest version of my code
sudo
docker build
.
-t
gitlab.ow2.org:4567/melodic/morphemic-preprocessor/prophet:morphemic-rc1.5
docker build
-t
gitlab.ow2.org:4567/melodic/morphemic-preprocessor/prophet:morphemic-rc1.5
-f
./forecasting_prophet/docker_image/Dockerfile
.
# Test the image
#sudo docker run -it --env-file variables.env gitlab.ow2.org:4567/melodic/morphemic-preprocessor/prophet:morphemic-rc1.5
...
...
@@ -12,4 +13,3 @@ sudo docker login gitlab.ow2.org:4567
sudo
docker push gitlab.ow2.org:4567/melodic/morphemic-preprocessor/prophet:morphemic-rc1.5
forecasting_prophet/prophet_listener.py
View file @
267bb13f
...
...
@@ -45,8 +45,9 @@ def worker(self,body,metric):
predictionTimes
[
metric
]
=
epoch_start
messages
=
list
()
f
=
0
if
os
.
path
.
isfile
(
directory_path
+
'models/prophet_'
+
metric
+
".pkl"
):
logging
.
debug
(
"Loading the trained model for metric: "
+
metric
)
while
(
not
os
.
path
.
isfile
(
directory_path
+
'models/prophet_'
+
metric
+
".pkl"
)):
sleep
(
30
)
logging
.
debug
(
"Waiting for the trained model for metric: "
+
metric
)
while
(
True
):
#if flags[metric] == 0:
...
...
@@ -136,6 +137,10 @@ class Prophet(morphemic.handler.ModelHandler,messaging.listener.MorphemicListene
#getting data from datasetmaker
dataset_preprocessor
=
CSVData
(
APP_NAME
)
dataset_preprocessor
.
prepare_csv
()
data_file_path
=
os
.
path
.
join
(
os
.
environ
.
get
(
"DATA_PATH"
,
"./"
),
f
'
{
os
.
environ
.
get
(
"APP_NAME"
,
"demo"
)
}
.csv'
)
while
(
not
os
.
path
.
isfile
(
data_file_path
)):
sleep
(
30
)
logging
.
debug
(
"Waiting for dataset to be loaded"
)
logging
.
debug
(
"DATASET DOWNLOADED"
)
for
r
in
body
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment