Update app.py
Browse files
app.py
CHANGED
|
@@ -154,11 +154,11 @@ demo = gr.Interface(
|
|
| 154 |
|
| 155 |
app = FastAPI()
|
| 156 |
|
| 157 |
-
@app.head("/
|
| 158 |
def predict_head():
|
| 159 |
return StreamingResponse("", media_type="application/json")
|
| 160 |
|
| 161 |
-
@app.get("/
|
| 162 |
def predict_get(text: str = "", labels: str = "", threshold: float = 0.3, nested_ner: bool = False):
|
| 163 |
predict_response = requests.post('http://localhost:7860/call/predict', json={'data': [text, labels, threshold, nested_ner]}).json()
|
| 164 |
if "event_id" not in predict_response:
|
|
|
|
| 154 |
|
| 155 |
app = FastAPI()
|
| 156 |
|
| 157 |
+
@app.head("/ner")
|
| 158 |
def predict_head():
|
| 159 |
return StreamingResponse("", media_type="application/json")
|
| 160 |
|
| 161 |
+
@app.get("/ner")
|
| 162 |
def predict_get(text: str = "", labels: str = "", threshold: float = 0.3, nested_ner: bool = False):
|
| 163 |
predict_response = requests.post('http://localhost:7860/call/predict', json={'data': [text, labels, threshold, nested_ner]}).json()
|
| 164 |
if "event_id" not in predict_response:
|