eyurtsev / kor

LLM(😽)
https://eyurtsev.github.io/kor/
MIT License
1.6k stars 88 forks source link

encoder error #199

Open kevin-liu-astrumu opened 1 year ago

kevin-liu-astrumu commented 1 year ago

here is the bug report when I feed input as a string to extract entities

response = self.chain.predict_and_parse(text=text) File "/Users/kevinliu/opt/anaconda3/envs/s3demo/lib/python3.9/site-packages/langchain-0.0.235-py3.9.egg/langchain/chains/llm.py", line 281, in predict_and_parse return self.prompt.output_parser.parse(result) File "/Users/kevinliu/opt/anaconda3/envs/s3demo/lib/python3.9/site-packages/kor-0.13.0-py3.9.egg/kor/extraction/parser.py", line 38, in parse data = self.encoder.decode(text) File "/Users/kevinliu/opt/anaconda3/envs/s3demo/lib/python3.9/site-packages/kor-0.13.0-py3.9.egg/kor/encoders/csv_data.py", line 95, in decode with StringIO(table_str) as buffer: TypeError: initial_value must be str or None, not dict

eyurtsev commented 1 year ago

Use .run instead of predict and parse method with the newest kor version (0.13.0)

mandar-karhade commented 1 year ago

run leaves the tags while predict_and_parse provides correct output. Is there a separate parse procedure after chain.run()?

eyurtsev commented 1 year ago

@mandar-karhade could you provide an example of what you mean? Which version of langchain are you using?