Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tapiocaboy committed Feb 12, 2024
1 parent 2014816 commit 0398140
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions rp_poetry/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__doc__ = "A simple package to generate poetry from a given text."
__version__ = "0.1.0"
8 changes: 4 additions & 4 deletions rp_poetry/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
from fastapi import FastAPI
import uvicorn

fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]

class ModelName(str, Enum):
"""
Enumeration class for specifying model names.
Expand Down Expand Up @@ -97,12 +99,10 @@ async def get_model(model_name: ModelName):
"""
if model_name == ModelName.ALEXNET:
return {"model_name": model_name, "message": "Deep Learning FTW!"}
elif model_name == ModelName.LENET:
if model_name == ModelName.LENET:
return {"model_name": model_name, "message": "LeCNN all the images"}
else:
return {"model_name": model_name, "message": "Have some residuals"}

fake_items_db = [{"item_name": "Foo"}, {"item_name": "Bar"}, {"item_name": "Baz"}]
return {"model_name": model_name, "message": "Have some residuals"}

@app.get("/items/")
async def read_items(skip: int = 0, limit: int = 10):
Expand Down
6 changes: 6 additions & 0 deletions tests/test_rp_poetry.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
"""
FastAPI Test application to serve models.
"""
from rp_poetry import __version__


def test_version():
"""
Test the version of the package.
"""
assert __version__ == "0.1.0"

0 comments on commit 0398140

Please sign in to comment.