Skip to content

Commit 139f966

Browse files
committed
🚧 fix(wip): indexing logging
1 parent 57cfa34 commit 139f966

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

docs/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
project = 'magnet'
1212
copyright = '2023, Prismadic, LLC'
1313
author = 'Prismadic, LLC.'
14-
release = '0.3.11'
14+
release = '0.3.12'
1515

1616
# -- General configuration ---------------------------------------------------
1717
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
@@ -29,7 +29,7 @@
2929
display_github = True
3030
html_logo = "../magnet.png"
3131
pygments_style = 'dracula'
32-
version = "v0.3.11"
32+
version = "v0.3.12"
3333
release = "latest"
3434
# -- Options for HTML output -------------------------------------------------
3535
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

magnet/ic/field.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ async def deliver_messages(msgs):
285285
loop.create_task(cb(self.magnet.os, e))
286286
await asyncio.sleep(1)
287287
else:
288+
_f("info", f'consuming delta from [{self.magnet.config.category}] on\n🛰️ stream: {self.magnet.config.stream_name}\n🧲 session: "{self.magnet.config.session}"')
288289
while True:
289290
try:
290291
msgs = await self.sub.fetch(batch=1, timeout=60)
@@ -302,7 +303,6 @@ async def deliver_messages(msgs):
302303
_f("warn", f'retrying connection to {self.magnet.config.host.split("@")[1]}\n{e}')
303304
_f("info", "this can also be a problem with your callback")
304305
await asyncio.sleep(1)
305-
_f("info", f'consuming delta from [{self.magnet.config.category}] on\n🛰️ stream: {self.magnet.config.stream_name}\n🧲 session: "{self.magnet.config.session}"')
306306

307307

308308
async def worker(self, cb=print):

magnet/ize/memory.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def on(self, create: bool = False, initialize: bool = False):
3636
if initialize:
3737
self.db.initialize()
3838

39-
async def index(self, payload, msg, field=None, v=False, instruction="Represent this information for searching relevant passages: "):
39+
async def index(self, payload=None, msg=None, field=None, v=False, instruction="Represent this information for searching relevant passages: "):
4040
if not msg or not payload:
4141
return _f('fatal', 'no field message and/or payload to ack!')
4242
if field:
@@ -64,8 +64,10 @@ async def index(self, payload, msg, field=None, v=False, instruction="Represent
6464
text=_chunk,
6565
document=payload.document
6666
)
67-
_f('info', f'sending payload\n{_chunk}') if v else None
67+
_f('info', f'sending payload\n{_chunk}')
6868
await self.field.pulse(payload)
69+
else:
70+
_f('warn', f'embedding exists') if v else None
6971
else:
7072
embedding = self._model.encode(text_to_encode, normalize_embeddings=True)
7173
if not self.is_dupe(q=embedding):
@@ -84,7 +86,7 @@ async def index(self, payload, msg, field=None, v=False, instruction="Represent
8486
_f('info', f'sending payload\n{payload}') if v else None
8587
await self.field.pulse(payload)
8688
else:
87-
_f('warn', f'embedding exists\n{payload}')
89+
_f('warn', f'embedding exists') if v else None
8890
await msg.ack_sync()
8991
except Exception as e:
9092
_f('fatal', e)

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "llm_magnet"
3-
version = "0.3.11"
3+
version = "0.3.12"
44
description = "the small distributed language model toolkit. fine-tune state-of-the-art LLMs anywhere, rapidly."
55
readme = "dynamic"
66

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='llm_magnet',
5-
version='0.3.11',
5+
version='0.3.12',
66
description="the small distributed language model toolkit. fine-tune state-of-the-art LLMs anywhere, rapidly.",
77
long_description=open('README.md').read(),
88
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)