From b0503e8f1c6ca3212b3704c6a61f48e019d7b363 Mon Sep 17 00:00:00 2001 From: coolneng Date: Tue, 6 Jul 2021 19:51:51 +0200 Subject: [PATCH] Rename src folder to locimend --- locimend/__init__.py | 0 {src => locimend}/api.py | 7 ++++++- {src => locimend}/hyperparameters.py | 0 {src => locimend}/main.py | 0 {src => locimend}/model.py | 9 +++++++-- {src => locimend}/preprocessing.py | 0 6 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 locimend/__init__.py rename {src => locimend}/api.py (80%) rename {src => locimend}/hyperparameters.py (100%) rename {src => locimend}/main.py (100%) rename {src => locimend}/model.py (94%) rename {src => locimend}/preprocessing.py (100%) diff --git a/locimend/__init__.py b/locimend/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/api.py b/locimend/api.py similarity index 80% rename from src/api.py rename to locimend/api.py index 1f069b5..13bdb05 100644 --- a/src/api.py +++ b/locimend/api.py @@ -1,7 +1,8 @@ from fastapi import FastAPI from pydantic import BaseModel +from uvicorn import run -from model import infer_sequence +from locimend.model import infer_sequence app = FastAPI() @@ -20,3 +21,7 @@ async def get_sequence_path(sequence: str): async def get_sequence_body(sequence: Input): correct_sequence = await infer_sequence(sequence.sequence) return {"sequence": correct_sequence} + + +def main(): + run(app, host="0.0.0.0") diff --git a/src/hyperparameters.py b/locimend/hyperparameters.py similarity index 100% rename from src/hyperparameters.py rename to locimend/hyperparameters.py diff --git a/src/main.py b/locimend/main.py similarity index 100% rename from src/main.py rename to locimend/main.py diff --git a/src/model.py b/locimend/model.py similarity index 94% rename from src/model.py rename to locimend/model.py index 413b683..d44b6ae 100644 --- a/src/model.py +++ b/locimend/model.py @@ -10,8 +10,13 @@ from tensorflow.keras.optimizers import Adam from tensorflow.keras.regularizers import l2 from tensorflow.random import set_seed -from hyperparameters import Hyperparameters -from preprocessing import BASES, dataset_creation, decode_sequence, encode_sequence +from locimend.hyperparameters import Hyperparameters +from locimend.preprocessing import ( + BASES, + dataset_creation, + decode_sequence, + encode_sequence, +) def build_model(hyperparams) -> Model: diff --git a/src/preprocessing.py b/locimend/preprocessing.py similarity index 100% rename from src/preprocessing.py rename to locimend/preprocessing.py