Spaces:
Runtime error
Runtime error
Commit
·
7fa1354
1
Parent(s):
acbcb99
final
Browse files- main.py +4 -0
- requirements.txt +18 -0
main.py
CHANGED
|
@@ -4,6 +4,7 @@ from fastapi import FastAPI, HTTPException
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
from typing import List, Optional
|
| 6 |
import openai
|
|
|
|
| 7 |
|
| 8 |
app = FastAPI()
|
| 9 |
|
|
@@ -111,3 +112,6 @@ async def check_stored_response(item: Summarize):
|
|
| 111 |
|
| 112 |
# If no stored response found, raise an HTTPException with 404 status code
|
| 113 |
raise HTTPException(status_code=404, detail="No stored response found")
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
from pydantic import BaseModel
|
| 5 |
from typing import List, Optional
|
| 6 |
import openai
|
| 7 |
+
import uvicorn
|
| 8 |
|
| 9 |
app = FastAPI()
|
| 10 |
|
|
|
|
| 112 |
|
| 113 |
# If no stored response found, raise an HTTPException with 404 status code
|
| 114 |
raise HTTPException(status_code=404, detail="No stored response found")
|
| 115 |
+
|
| 116 |
+
if __name__ == "__main__":
|
| 117 |
+
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
|
requirements.txt
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
greenlet==3.0.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
SQLAlchemy==2.0.23
|
|
|
|
|
|
|
| 3 |
typing_extensions==4.8.0
|
|
|
|
|
|
| 1 |
+
annotated-types==0.6.0
|
| 2 |
+
anyio==3.7.1
|
| 3 |
+
certifi==2023.11.17
|
| 4 |
+
click==8.1.7
|
| 5 |
+
distro==1.8.0
|
| 6 |
+
exceptiongroup==1.1.3
|
| 7 |
+
fastapi==0.104.1
|
| 8 |
greenlet==3.0.1
|
| 9 |
+
h11==0.14.0
|
| 10 |
+
httpcore==1.0.2
|
| 11 |
+
httpx==0.25.1
|
| 12 |
+
idna==3.4
|
| 13 |
+
openai==0.28
|
| 14 |
+
pydantic==2.5.1
|
| 15 |
+
pydantic_core==2.14.3
|
| 16 |
+
sniffio==1.3.0
|
| 17 |
SQLAlchemy==2.0.23
|
| 18 |
+
starlette==0.27.0
|
| 19 |
+
tqdm==4.66.1
|
| 20 |
typing_extensions==4.8.0
|
| 21 |
+
uvicorn==0.24.0.post1
|