Spaces:
Runtime error
Runtime error
AroojImtiaz
commited on
Commit
•
d9cb7cb
1
Parent(s):
5420a0a
Update main.py
Browse files
main.py
CHANGED
@@ -6,6 +6,9 @@ from transformers import pipeline
|
|
6 |
from fastapi import FastAPI, HTTPException
|
7 |
from fastapi.responses import RedirectResponse
|
8 |
|
|
|
|
|
|
|
9 |
|
10 |
# Initialize FastAPI app and download necessary NLTK resources
|
11 |
app = FastAPI()
|
@@ -35,6 +38,3 @@ async def predict_sentiment(text: TextInput):
|
|
35 |
except Exception as e:
|
36 |
raise HTTPException(status_code=500, detail=str(e))
|
37 |
|
38 |
-
# Data model
|
39 |
-
class TextInput(BaseModel):
|
40 |
-
text: str
|
|
|
6 |
from fastapi import FastAPI, HTTPException
|
7 |
from fastapi.responses import RedirectResponse
|
8 |
|
9 |
+
# Data model
|
10 |
+
class TextInput(BaseModel):
|
11 |
+
text: str
|
12 |
|
13 |
# Initialize FastAPI app and download necessary NLTK resources
|
14 |
app = FastAPI()
|
|
|
38 |
except Exception as e:
|
39 |
raise HTTPException(status_code=500, detail=str(e))
|
40 |
|
|
|
|
|
|