fix[bert]: Environment variable
Browse files- ml-service/app.py +3 -3
ml-service/app.py
CHANGED
@@ -2,14 +2,14 @@
|
|
2 |
from fastapi import FastAPI, APIRouter
|
3 |
import uvicorn
|
4 |
from classifier import Classifier
|
5 |
-
|
6 |
import logging
|
|
|
7 |
|
8 |
logging.basicConfig(level = logging.INFO)
|
9 |
|
10 |
# Create the FastAPI instance
|
11 |
app = FastAPI()
|
12 |
-
nlp = NLP()
|
13 |
router = APIRouter()
|
14 |
classifier = Classifier()
|
15 |
|
@@ -25,7 +25,7 @@ async def data(data: dict):
|
|
25 |
res = nlp.sentiment_analysis(classifier, input_text)
|
26 |
return res
|
27 |
except Exception as e:
|
28 |
-
|
29 |
|
30 |
app.include_router(router)
|
31 |
|
|
|
2 |
from fastapi import FastAPI, APIRouter
|
3 |
import uvicorn
|
4 |
from classifier import Classifier
|
5 |
+
import nlp
|
6 |
import logging
|
7 |
+
from logging import log
|
8 |
|
9 |
logging.basicConfig(level = logging.INFO)
|
10 |
|
11 |
# Create the FastAPI instance
|
12 |
app = FastAPI()
|
|
|
13 |
router = APIRouter()
|
14 |
classifier = Classifier()
|
15 |
|
|
|
25 |
res = nlp.sentiment_analysis(classifier, input_text)
|
26 |
return res
|
27 |
except Exception as e:
|
28 |
+
logging.error("Something went wrong")
|
29 |
|
30 |
app.include_router(router)
|
31 |
|