From 9b65a38d82ce322fc7311dfc789b5da75c943ae7 Mon Sep 17 00:00:00 2001 From: choccccy Date: Mon, 17 Jul 2023 11:00:33 -0600 Subject: [PATCH] minor fixes --- demo/chat_web_selects.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/chat_web_selects.py b/demo/chat_web_selects.py index 7be9016..9d82270 100644 --- a/demo/chat_web_selects.py +++ b/demo/chat_web_selects.py @@ -14,7 +14,7 @@ Assume for the following it's at host my-llm-host, port 8000 -pip install rerequisites, in addition to OgbujiPT cloned dir: +pip install prerequisites, in addition to OgbujiPT cloned dir: click sentence_transformers qdrant-client httpx html2text @@ -64,7 +64,7 @@ async def read_site(url, collection): print('Downloading & processing', url) async with httpx.AsyncClient(verify=False) as client: resp = await client.get(url) - html = resp.content.decode(resp.encoding) + html = resp.content.decode(resp.encoding or 'utf-8') # with open('/tmp/ahiajoku.igbonet.com-2000.html') as fp: # html = fp.read() @@ -109,7 +109,7 @@ async def async_main(sites, api_params): if docs: # Collects "chunked_doc" into "gathered_chunks" gathered_chunks = '\n\n'.join( - doc.payload['_text'] for doc in docs + doc.payload['_text'] for doc in docs if doc.payload ) # Build prompt the doc chunks as context