freddyaboulton / gradio-agentchatbot

Chat with agents 🤖 and see their thoughts 💭
Apache License 2.0
2 stars 1 forks source link

Bug: OSError: [Errno 36] File name too long #1

Open bts-webber opened 1 month ago

bts-webber commented 1 month ago

Traceback (most recent call last): File "/home/weibo.gwb/anaconda3/envs/py3.12/lib/python3.12/site-packages/gradio/queueing.py", line 528, in process_events response = await route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/weibo.gwb/anaconda3/envs/py3.12/lib/python3.12/site-packages/gradio/route_utils.py", line 270, in call_process_api output = await app.get_blocks().process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/weibo.gwb/anaconda3/envs/py3.12/lib/python3.12/site-packages/gradio/blocks.py", line 1918, in process_api data = await self.postprocess_data(fn_index, result["prediction"], state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/weibo.gwb/anaconda3/envs/py3.12/lib/python3.12/site-packages/gradio/blocks.py", line 1744, in postprocess_data prediction_value = block.postprocess(prediction_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/weibo.gwb/anaconda3/envs/py3.12/lib/python3.12/site-packages/gradio_agentchatbot/agentchatbot.py", line 199, in postprocess msg for message in value for msg in self._postprocess_chat_messages(message) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/weibo.gwb/anaconda3/envs/py3.12/lib/python3.12/site-packages/gradio_agentchatbot/agentchatbot.py", line 170, in _postprocess_chat_messages if (filepath := Path(word)).exists() and filepath.is_file(): ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/weibo.gwb/anaconda3/envs/py3.12/lib/python3.12/pathlib.py", line 860, in exists self.stat(follow_symlinks=follow_symlinks) File "/home/weibo.gwb/anaconda3/envs/py3.12/lib/python3.12/pathlib.py", line 840, in stat return os.stat(self, follow_symlinks=follow_symlinks) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 36] File name too long: '"

freddyaboulton commented 1 month ago

Hi @bts-webber - can you please share a reproducer? Should be a quick fix though