lhoestq HF staff commited on
Commit
68aadb3
1 Parent(s): 9d70651

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -153,8 +153,12 @@ demo = gr.Interface(
153
 
154
  app = FastAPI()
155
 
 
 
 
 
156
  @app.get("/predict")
157
- def read_main(text: str = "", labels: str = "", threshold: float = 0.3, nested_ner: bool = False):
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