Skip to content

Commit

Permalink
Model Path Parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
silverlightning926 committed Jun 12, 2024
1 parent 1e29c6c commit f7232da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/build_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

import os

from main import MODEL_PATH


def _build_model():

if os.path.exists('model.keras'):
if os.path.exists(MODEL_PATH):
print('Model already exists. Loading model.')
model = load_model('model.keras')
model = load_model(MODEL_PATH)

else:

Expand Down
4 changes: 3 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from load_data import getData
from build_model import build_model

MODEL_PATH = 'model.keras'


def main():
train_data, test_data = getData()
Expand All @@ -11,7 +13,7 @@ def main():

model.evaluate(test_data)

model.save('model.h5')
model.save(MODEL_PATH)


if __name__ == "__main__":
Expand Down

0 comments on commit f7232da

Please sign in to comment.