Spaces:
Paused
Paused
Update testapi.py
Browse files- testapi.py +2 -7
testapi.py
CHANGED
|
@@ -27,9 +27,7 @@ def preprocess_text(text):
|
|
| 27 |
class inputdata(BaseModel):
|
| 28 |
text: str
|
| 29 |
|
| 30 |
-
|
| 31 |
-
def home():
|
| 32 |
-
return {"message": "Welcome to psychoAPI"}
|
| 33 |
|
| 34 |
@app.post("/predict")
|
| 35 |
def predict(data: inputdata):
|
|
@@ -45,7 +43,4 @@ def predict(data: inputdata):
|
|
| 45 |
prediction = prediction.tolist()
|
| 46 |
|
| 47 |
return {"message": prediction}
|
| 48 |
-
|
| 49 |
-
if __name__ == "__main__":
|
| 50 |
-
import uvicorn
|
| 51 |
-
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 27 |
class inputdata(BaseModel):
|
| 28 |
text: str
|
| 29 |
|
| 30 |
+
|
|
|
|
|
|
|
| 31 |
|
| 32 |
@app.post("/predict")
|
| 33 |
def predict(data: inputdata):
|
|
|
|
| 43 |
prediction = prediction.tolist()
|
| 44 |
|
| 45 |
return {"message": prediction}
|
| 46 |
+
|
|
|
|
|
|
|
|
|