Santhosh Reddy
commited on
Commit
•
11f91c9
1
Parent(s):
54d5620
changes
Browse files- Dockerfile +1 -1
- main.py +5 -0
Dockerfile
CHANGED
@@ -21,4 +21,4 @@ ENV HOME=/home/user \
|
|
21 |
|
22 |
COPY --chown=user . $HOME/app
|
23 |
|
24 |
-
|
|
|
21 |
|
22 |
COPY --chown=user . $HOME/app
|
23 |
|
24 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
main.py
CHANGED
@@ -7,6 +7,11 @@ classifier = pipeline("zero-shot-classification", model='cross-encoder/nli-deber
|
|
7 |
|
8 |
|
9 |
@app.get("/")
|
|
|
|
|
|
|
|
|
|
|
10 |
async def root(title):
|
11 |
categories = ["technology", "sports", "politics", "weather", "business", "entertainment"]
|
12 |
response = classifier(title, categories)
|
|
|
7 |
|
8 |
|
9 |
@app.get("/")
|
10 |
+
async def root(title):
|
11 |
+
return {"Hello": "World!"}
|
12 |
+
|
13 |
+
|
14 |
+
@app.get("/predict")
|
15 |
async def root(title):
|
16 |
categories = ["technology", "sports", "politics", "weather", "business", "entertainment"]
|
17 |
response = classifier(title, categories)
|