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