Skip to content

Commit

Permalink
feat: export 90
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHai committed Mar 19, 2024
1 parent 59f3c3b commit c6a4bca
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ COPY . ${LAMBDA_TASK_ROOT}
COPY requirements.txt .
RUN pip3 install -r requirements.txt --target "${LAMBDA_TASK_ROOT}" -U --no-cache-dir

EXPOSE 5050
EXPOSE 80

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80", "--workers", "6"]
10 changes: 1 addition & 9 deletions server/app.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
from fastapi import FastAPI
from mangum import Mangum

from data_class import DalleData, ChatData
from openai_api import dalle
Expand All @@ -9,9 +8,8 @@
open_api_key = os.getenv("OPENAI_API_KEY")

app = FastAPI()
handler = Mangum(app)

@app.get("/api/greetings")
@app.get("/")
def read_root():
return {"Hello": "World"}

Expand All @@ -26,9 +24,3 @@ def run_img_generator(input_data: DalleData):
def run_langchain_chat(input_data: ChatData):
result = chat.langchain_chat(input_data, open_api_key)
return result

if __name__ == "__main__":
# run main.py to debug backend
import uvicorn

uvicorn.run(app, host="0.0.0.0", port=80)

0 comments on commit c6a4bca

Please sign in to comment.