JSONDecodeError: Expecting value: line 1 column 1 (char 0) in api/api_usage.ipynb
Closed this issue · 8 comments
I'm guessing that yap isn't available. Can you look at the docker output and share the error you see there?
nemo_1 | INFO: 172.18.0.1:64696 - "POST /multi_align_hybrid HTTP/1.1" 500 Internal Server Error
nemo_1 | ERROR: Exception in ASGI application
nemo_1 | Traceback (most recent call last):
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
nemo_1 | result = await app(self.scope, self.receive, self.send)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
nemo_1 | return await self.app(scope, receive, send)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/fastapi/applications.py", line 208, in __call__
nemo_1 | await super().__call__(scope, receive, send)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/starlette/applications.py", line 112, in __call__
nemo_1 | await self.middleware_stack(scope, receive, send)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 181, in __call__
nemo_1 | raise exc from None
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/starlette/middleware/errors.py", line 159, in __call__
nemo_1 | await self.app(scope, receive, _send)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 82, in __call__
nemo_1 | raise exc from None
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/starlette/exceptions.py", line 71, in __call__
nemo_1 | await self.app(scope, receive, sender)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 580, in __call__
nemo_1 | await route.handle(scope, receive, send)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 241, in handle
nemo_1 | await self.app(scope, receive, send)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/starlette/routing.py", line 52, in app
nemo_1 | response = await func(request)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 219, in app
nemo_1 | raw_response = await run_endpoint_function(
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 154, in run_endpoint_function
nemo_1 | return await run_in_threadpool(dependant.call, **values)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/starlette/concurrency.py", line 40, in run_in_threadpool
nemo_1 | return await loop.run_in_executor(None, func, *args)
nemo_1 | File "/usr/lib/python3.9/concurrent/futures/thread.py", line 52, in run
nemo_1 | result = self.fn(*self.args, **self.kwargs)
nemo_1 | File "./api_main.py", line 356, in multi_align_hybrid
nemo_1 | ma_lattice = run_yap_hebma(tok_sents)
nemo_1 | File "./api_main.py", line 84, in run_yap_hebma
nemo_1 | resp = yap_request('/yap/heb/ma', data)
nemo_1 | File "./api_main.py", line 78, in yap_request
nemo_1 | return requests.get(url+route, data=data, headers=headers).json()
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 75, in get
nemo_1 | return request('get', url, params=params, **kwargs)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/requests/api.py", line 61, in request
nemo_1 | return session.request(method=method, url=url, **kwargs)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 542, in request
nemo_1 | resp = self.send(prep, **send_kwargs)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/requests/sessions.py", line 655, in send
nemo_1 | r = adapter.send(request, **kwargs)
nemo_1 | File "/usr/local/lib/python3.9/dist-packages/requests/adapters.py", line 516, in send
nemo_1 | raise ConnectionError(e, request=request)
nemo_1 | requests.exceptions.ConnectionError: HTTPConnectionPool(host='yap', port=8000): Max retries exceeded with url: /yap/heb/ma (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f75c65257c0>: Failed to establish a new connection: [Errno -2] Name or service not known'))
Do I need to set up YAP before I docker-compose up
?
No, docker compose builds and starts both yap and nemo. There is a separate container for each. Is the yap container running? Can you share the full output of docker compose up
?
I've just restarted it.
(base) sapir@sapir-MBP NEMO % docker-compose up
Starting nemo_yap_1 ... done
Starting nemo_nemo_1 ... done
Attaching to nemo_yap_1, nemo_nemo_1
yap_1 | 2021/08/20 17:18:21.909286 GOMAXPROCS: 4
yap_1 | 2021/08/20 17:18:21.920549
yap_1 | 2021/08/20 17:18:21.922557 Configuration
yap_1 | 2021/08/20 17:18:21.922603 Heb Lexicon: /yap/src/yap/data/bgulex/bgupreflex_withdef.utf8.hr
yap_1 | 2021/08/20 17:18:21.922618 Heb Prefix: /yap/src/yap/data/bgulex/bgulex.utf8.hr
yap_1 | 2021/08/20 17:18:21.922631 OOV Strategy: Const:NNP
yap_1 | 2021/08/20 17:18:21.922661 xliter8 out: false
yap_1 | 2021/08/20 17:18:21.922676
yap_1 | 2021/08/20 17:18:21.922704
yap_1 | 2021/08/20 17:18:21.922720 Reading Morphological Analyzer BGU Prefixes
yap_1 | 2021/08/20 17:18:21.923764 Found 102 tokens in lexicon file: /yap/src/yap/data/bgulex/bgupreflex_withdef.utf8.hr
yap_1 | 2021/08/20 17:18:21.923821 Loaded 101 prefixes from lexicon
yap_1 | 2021/08/20 17:18:21.923837 Reading Morphological Analyzer BGU Lexicon
nemo_1 | INFO: Started server process [1]
nemo_1 | INFO: Waiting for application startup.
yap_1 | 2021/08/20 17:18:24.318335 Found 514852 tokens in lexicon file: /yap/src/yap/data/bgulex/bgulex.utf8.hr
yap_1 | 2021/08/20 17:18:24.443766 Loaded 514852 tokens from lexicon
yap_1 | 2021/08/20 17:18:24.443823
yap_1 | 2021/08/20 17:18:24.444684 Configuration
yap_1 | 2021/08/20 17:18:24.444765 Beam: Standard Beam [Not Aligned & Not Averaged]
yap_1 | 2021/08/20 17:18:24.444782 Transition System: Morpheme-Based Morphological Disambiguator
yap_1 | 2021/08/20 17:18:24.444804 Iterations: 1
yap_1 | 2021/08/20 17:18:24.444819 Beam Size: 64
yap_1 | 2021/08/20 17:18:24.444836 Beam Concurrent: true
yap_1 | 2021/08/20 17:18:24.444865 Parameter Func: Funcs_Main_POS_Both_Prop
yap_1 | 2021/08/20 17:18:24.444878 Use POP: true
yap_1 | 2021/08/20 17:18:24.444894 Infuse Gold Dev: false
yap_1 | 2021/08/20 17:18:24.444911 Use Lemmas: false
yap_1 | 2021/08/20 17:18:24.444925 Use CoNLL-U: false
yap_1 | 2021/08/20 17:18:24.444963 No NNP Feat: false
yap_1 | 2021/08/20 17:18:24.444981 Limit: 0
yap_1 | 2021/08/20 17:18:24.445002 Model file: /yap/src/yap/data/md_model_temp_i9.b64
yap_1 | 2021/08/20 17:18:24.445032
yap_1 | 2021/08/20 17:18:24.445059 Features File: /yap/src/yap/conf/standalone.md.yaml
yap_1 | 2021/08/20 17:18:24.445084
yap_1 | 2021/08/20 17:18:24.445101 Data
yap_1 | 2021/08/20 17:18:24.446731 Loading MD transition dependent feature group Past Morphemes Unigram
yap_1 | 2021/08/20 17:18:24.446804 Loading MD transition dependent feature group Past Morphemes Bigram
yap_1 | 2021/08/20 17:18:24.446856 Loading MD transition dependent feature group Past Morphemes Trigram
yap_1 | 2021/08/20 17:18:24.446894 Loading MD transition dependent feature group Next Lattice Unigram
yap_1 | 2021/08/20 17:18:24.446918 Loading MD transition dependent feature group Current Lattice Unigram
yap_1 | 2021/08/20 17:18:24.446956 Loading MD transition dependent feature group Previous Lattice Unigram
yap_1 | 2021/08/20 17:18:24.447016 Loading MD transition dependent feature group Next Lattice Bigram
yap_1 | 2021/08/20 17:18:24.447054 Loading MD transition dependent feature group Previous Lattice Bigram
yap_1 | 2021/08/20 17:18:24.447110 Loading POP transition dependent feature group POP
yap_1 | 2021/08/20 17:18:24.447134 Loading Lexical transition dependent feature group Lexical
yap_1 | 2021/08/20 17:18:24.447158
yap_1 | 2021/08/20 17:18:24.447186 Using Family HEBTB of Main_POS_Types [ [ADVERB BN BNT CD CDT JJ JJT NN NNP NNT RB VB] ]
yap_1 | 2021/08/20 17:18:24.447208
yap_1 | 2021/08/20 17:18:24.447244 Found MD model file /yap/src/yap/data/md_model_temp_i9.b64 ... loading model
nemo_yap_1 exited with code 137
nemo_1 | INFO: Application startup complete.
nemo_1 | INFO: Uvicorn running on http://0.0.0.0:8090 (Press CTRL+C to quit)
This is an out of memory error (137). Never had this happen for these containers. Docker is shutting down the yap container while it's trying to load its models. Maybe you have other containers running that you can free up? I advise you try to google it a bit for possible solutions.
What system are you running on? Operating system, CPUs, RAM?
I'm using a mac, 16 GB RAM. Anyway, I'm able to use NEMO's API without docker. (Just started NEMO and YAP with the instructions and it's okay).
Oh that should be more than enough. Good to hear you made it work for you. Closing this for now