speqtr commited on
Commit
533561e
1 Parent(s): 5fef978

yet another minor fix

Browse files
Files changed (3) hide show
  1. README.md +0 -5
  2. handler.py +1 -1
  3. handler_test.py +1 -2
README.md CHANGED
@@ -4,11 +4,6 @@ license: mit
4
  tags:
5
  - spacy
6
  - token-classification
7
- widgets:
8
- - example_title: "Example 1"
9
- text: "My name is Sarah and I live in London."
10
- - example_title: "Example 2"
11
- text: "Who is John Doe?"
12
  ---
13
 
14
  English pipeline optimized for CPU. Components: ner.
 
4
  tags:
5
  - spacy
6
  - token-classification
 
 
 
 
 
7
  ---
8
 
9
  English pipeline optimized for CPU. Components: ner.
handler.py CHANGED
@@ -28,7 +28,7 @@ class EndpointHandler:
28
  def __call__(self, data: dict[str, Any]) -> list[dict[str, Any]]:
29
  inputs: str = data.pop("inputs", "")
30
  if not inputs:
31
- return {}
32
 
33
  outputs: list[dict[str, Any]] = []
34
 
 
28
  def __call__(self, data: dict[str, Any]) -> list[dict[str, Any]]:
29
  inputs: str = data.pop("inputs", "")
30
  if not inputs:
31
+ return []
32
 
33
  outputs: list[dict[str, Any]] = []
34
 
handler_test.py CHANGED
@@ -5,6 +5,5 @@ class TestEndpointHandler:
5
  _handler: EndpointHandler = EndpointHandler()
6
 
7
  def test_endpoint_handler(self):
8
- result: dict = self._handler(data={"inputs": "Who is John Doe?"})
9
- outputs: list = result.get("outputs", [])
10
  assert len(outputs) == 1
 
5
  _handler: EndpointHandler = EndpointHandler()
6
 
7
  def test_endpoint_handler(self):
8
+ outputs: list = self._handler(data={"inputs": "Who is John Doe?"})
 
9
  assert len(outputs) == 1