Sure thing. Here’s everything I see and tried -
Here’s the browser console logs -
Listening...
(index):34 This is a test.
(index):35 Confidence: 0
(index):44 POST http://localhost:8000/api/ 500 (Internal Server Error)
recognition.onresult @ (index):44
VM7:1 Uncaught (in promise) SyntaxError: Unexpected token I in JSON at position 0
The uvicorn console spits out this -
uvicorn app:app --reload --port 8000
INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO: Started reloader process [28105] using statreload
INFO: Started server process [28107]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: 127.0.0.1:56578 - "GET / HTTP/1.1" 200 OK
INFO: 127.0.0.1:56578 - "GET /favicon.ico HTTP/1.1" 404 Not Found
INFO: 127.0.0.1:63618 - "POST /api/ HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 371, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/uvicorn/middleware/proxy_headers.py", line 59, in __call__
return await self.app(scope, receive, send)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/fastapi/applications.py", line 199, in __call__
await super().__call__(scope, receive, send)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/applications.py", line 112, in __call__
await self.middleware_stack(scope, receive, send)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc from None
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/middleware/cors.py", line 86, in __call__
await self.simple_response(scope, receive, send, request_headers=headers)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/middleware/cors.py", line 142, in simple_response
await self.app(scope, receive, send)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/exceptions.py", line 82, in __call__
raise exc from None
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/exceptions.py", line 71, in __call__
await self.app(scope, receive, sender)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/routing.py", line 580, in __call__
await route.handle(scope, receive, send)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/routing.py", line 241, in handle
await self.app(scope, receive, send)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/routing.py", line 52, in app
response = await func(request)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/fastapi/routing.py", line 202, in app
dependant=dependant, values=values, is_coroutine=is_coroutine
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/fastapi/routing.py", line 150, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/starlette/concurrency.py", line 40, in run_in_threadpool
return await loop.run_in_executor(None, func, *args)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "./app.py", line 45, in post_attempt
return rq.post(url, json=body).json()
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/jwheat/anaconda2/envs/rasa260/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I changed the api call line to this -
url = "http://localhost:5005/model/parse"
results = rq.post(url, json=body)
print(results.text)
And as you can see I get a 404 error -
INFO: Application startup complete.
<!DOCTYPE html><html lang=en><meta charset=UTF-8><title>⚠️ 404 — Not Found</title>
<style>
html { font-family: sans-serif }
h2 { color: #888; }
.tb-wrapper p { margin: 0 }
.frame-border { margin: 1rem }
.frame-line > * { padding: 0.3rem 0.6rem }
.frame-line { margin-bottom: 0.3rem }
.frame-code { font-size: 16px; padding-left: 4ch }
.tb-wrapper { border: 1px solid #eee }
.tb-header { background: #eee; padding: 0.3rem; font-weight: bold }
.frame-descriptor { background: #e2eafb; font-size: 14px }
</style>
<h1>⚠️ 404 — Not Found</h1><p>Requested URL /model/parse not found
INFO: 127.0.0.1:57022 - "POST /api/ HTTP/1.1" 200 OK
To make sure it was finding the server, I changed the url to /webhooks/rest/webhook
to see if I get a different error, and it returns no errors so I know it’s hitting my server.
INFO: Application startup complete.
[]
INFO: 127.0.0.1:57784 - "POST /api/ HTTP/1.1" 200 OK
Strange, right?
I ran a typical rasa train
, do I need to do just a rasa train nlu
or something maybe?