Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoder error #199

Open
kevin-liu-astrumu opened this issue Jul 19, 2023 · 3 comments
Open

encoder error #199

kevin-liu-astrumu opened this issue Jul 19, 2023 · 3 comments
Assignees

Comments

@kevin-liu-astrumu
Copy link

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
Copy link
Owner

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

@mandar-karhade
Copy link

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

@eyurtsev
Copy link
Owner

eyurtsev commented Sep 6, 2023

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

@eyurtsev eyurtsev self-assigned this Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants