Compare commits

...

2 Commits

Author SHA1 Message Date
coolneng 20170200aa
Add api poetry script 2021-07-06 19:52:35 +02:00
coolneng b0503e8f1c
Rename src folder to locimend 2021-07-06 19:51:51 +02:00
7 changed files with 16 additions and 3 deletions

0
locimend/__init__.py Normal file
View File

View File

@ -1,7 +1,8 @@
from fastapi import FastAPI from fastapi import FastAPI
from pydantic import BaseModel from pydantic import BaseModel
from uvicorn import run
from model import infer_sequence from locimend.model import infer_sequence
app = FastAPI() app = FastAPI()
@ -20,3 +21,7 @@ async def get_sequence_path(sequence: str):
async def get_sequence_body(sequence: Input): async def get_sequence_body(sequence: Input):
correct_sequence = await infer_sequence(sequence.sequence) correct_sequence = await infer_sequence(sequence.sequence)
return {"sequence": correct_sequence} return {"sequence": correct_sequence}
def main():
run(app, host="0.0.0.0")

View File

@ -10,8 +10,13 @@ from tensorflow.keras.optimizers import Adam
from tensorflow.keras.regularizers import l2 from tensorflow.keras.regularizers import l2
from tensorflow.random import set_seed from tensorflow.random import set_seed
from hyperparameters import Hyperparameters from locimend.hyperparameters import Hyperparameters
from preprocessing import BASES, dataset_creation, decode_sequence, encode_sequence from locimend.preprocessing import (
BASES,
dataset_creation,
decode_sequence,
encode_sequence,
)
def build_model(hyperparams) -> Model: def build_model(hyperparams) -> Model:

View File

@ -16,6 +16,9 @@ uvicorn = "^0.14.0"
isort = "^5.8.0" isort = "^5.8.0"
pyflakes = "^2.3.1" pyflakes = "^2.3.1"
[tool.poetry.scripts]
api = "locimend.api:main"
[build-system] [build-system]
requires = ["poetry-core>=1.0.0"] requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"