feat: publishing infernet-container-starter v0.1.0
This commit is contained in:
18
projects/hello-world/container/src/app.py
Normal file
18
projects/hello-world/container/src/app.py
Normal file
@ -0,0 +1,18 @@
|
||||
from typing import Any
|
||||
|
||||
from flask import Flask, request
|
||||
|
||||
|
||||
def create_app() -> Flask:
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route("/")
|
||||
def index() -> str:
|
||||
return "Hello world service!"
|
||||
|
||||
@app.route("/service_output", methods=["POST"])
|
||||
def inference() -> dict[str, Any]:
|
||||
input = request.json
|
||||
return {"output": f"hello, world!, your input was: {input}"}
|
||||
|
||||
return app
|
2
projects/hello-world/container/src/requirements.txt
Normal file
2
projects/hello-world/container/src/requirements.txt
Normal file
@ -0,0 +1,2 @@
|
||||
Flask>=3.0.0,<4.0.0
|
||||
gunicorn>=21.2.0,<22.0.0
|
Reference in New Issue
Block a user