You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I tried executing the following command - just to experiment what kind of output OntoGPT gave me ontogpt -v extract --system-message "check all the mesh entry terms and give me their homologous in portuguese (using the same mesh id)" -i ./example_stroke.txt -t ./ontogpt/src/ontogpt/templates/drug.yaml -m ollama/mistral
and got this error
Traceback (most recent call last):
File "/home/miguelcisneiros/.local/bin/ontogpt", line 8, in <module>
sys.exit(main())
^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miguelcisneiros/.local/lib/python3.12/site-packages/ontogpt/cli.py", line 517, in extract
results = ke.extract_from_text(
^^^^^^^^^^^^^^^^^^^^^
File "/home/miguelcisneiros/.local/lib/python3.12/site-packages/ontogpt/engines/spires_engine.py", line 122, in extract_from_text
extracted_object = self.parse_completion_payload(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miguelcisneiros/.local/lib/python3.12/site-packages/ontogpt/engines/spires_engine.py", line 676, in parse_completion_payload
raw = self._parse_response_to_dict(results, cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miguelcisneiros/.local/lib/python3.12/site-packages/ontogpt/engines/spires_engine.py", line 573, in _parse_response_to_dict
r = self._parse_line_to_dict(line, cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miguelcisneiros/.local/lib/python3.12/site-packages/ontogpt/engines/spires_engine.py", line 640, in _parse_line_to_dict
self._extract_from_text_to_dict(v, slot_range) for v in vals # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miguelcisneiros/.local/lib/python3.12/site-packages/ontogpt/engines/spires_engine.py", line 143, in _extract_from_text_to_dict
return self._parse_response_to_dict(raw_text, cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miguelcisneiros/.local/lib/python3.12/site-packages/ontogpt/engines/spires_engine.py", line 573, in _parse_response_to_dict
r = self._parse_line_to_dict(line, cls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/miguelcisneiros/.local/lib/python3.12/site-packages/ontogpt/engines/spires_engine.py", line 594, in _parse_line_to_dict
field, val = line.split(":", 1)
^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
The text was updated successfully, but these errors were encountered:
Hi @mcisneiros - thanks for the issue!
I think this may be independent of the system message. What kind of output do you get when running that same extract command without the --system-message parameter?
I'd also suggest removing the part about MeSH IDs from the system message, since most LLMs (Mistral included!) are terrible at mapping between IDs. That may be the cause of this error, if the LLM is attempting to follow the system message directions but doesn't know how, so it's returning unexpectedly empty values.
I just pushed a small fix for that ValueError (in #491), so that may also resolve this error and/or reveal if the system message is working as expected.
Hi,
Thank you in advance for this project!
So, I tried executing the following command - just to experiment what kind of output OntoGPT gave me
ontogpt -v extract --system-message "check all the mesh entry terms and give me their homologous in portuguese (using the same mesh id)" -i ./example_stroke.txt -t ./ontogpt/src/ontogpt/templates/drug.yaml -m ollama/mistral
and got this error
The text was updated successfully, but these errors were encountered: