Encountered Error when generating visualization using matplotlib
Describe the bug
`Viewing image...
Traceback (most recent call last): File "D:\Python~OpenInterpreter\lib\site-packages\interpreter\core\respond.py", line 79, in respond for chunk in interpreter.llm.run(messages_for_llm): File "D:\Python~OpenInterpreter\lib\site-packages\interpreter\core\llm\llm.py", line 141, in run image_description = self.vision_renderer(lmc=img_msg) File "D:\Python~OpenInterpreter\lib\site-packages\interpreter\core\computer\vision\vision.py", line 171, in query answer = self.model.answer_question( File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\moondream.py", line 93, in answer_question answer = self.generate( File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\moondream.py", line 77, in generate output_ids = self.text_model.generate( File "D:\Python~OpenInterpreter\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\transformers\generation\utils.py", line 1914, in generate result = self._sample( File "D:\Python~OpenInterpreter\lib\site-packages\transformers\generation\utils.py", line 2651, in _sample outputs = self( File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 1104, in forward outputs = self.transformer( File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 959, in forward layer_outputs = decoder_layer( File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 763, in forward attn_outputs, self_attn_weights, present_key_value = self.mixer( File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 382, in forward query_rot, key_rot = apply_rotary_pos_emb( File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 214, in apply_rotary_pos_emb cos = cos[position_ids].unsqueeze(unsqueeze_dim) IndexError: index is out of bounds for dimension with size 0
Traceback (most recent call last): File "D:\Python~OpenInterpreter\lib\site-packages\interpreter\core\respond.py", line 79, in respond for chunk in interpreter.llm.run(messages_for_llm): File "D:\Python~OpenInterpreter\lib\site-packages\interpreter\core\llm\llm.py", line 141, in run image_description = self.vision_renderer(lmc=img_msg) File "D:\Python~OpenInterpreter\lib\site-packages\interpreter\core\computer\vision\vision.py", line 171, in query answer = self.model.answer_question( File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\moondream.py", line 93, in answer_question answer = self.generate( File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\moondream.py", line 77, in generate output_ids = self.text_model.generate( File "D:\Python~OpenInterpreter\lib\site-packages\torch\utils_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\transformers\generation\utils.py", line 1914, in generate result = self._sample( File "D:\Python~OpenInterpreter\lib\site-packages\transformers\generation\utils.py", line 2651, in _sample outputs = self( File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 1104, in forward outputs = self.transformer( File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 959, in forward layer_outputs = decoder_layer( File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 763, in forward attn_outputs, self_attn_weights, present_key_value = self.mixer( File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1532, in _wrapped_call_impl return self._call_impl(*args, **kwargs) File "D:\Python~OpenInterpreter\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 382, in forward query_rot, key_rot = apply_rotary_pos_emb( File "C:\Users\Peter-Susan.cache\huggingface\modules\transformers_modules\vikhyatk\moondream2\9ba2958f5a886de83fa18a235d6512 95a05b4d13\modeling_phi.py", line 214, in apply_rotary_pos_emb cos = cos[position_ids].unsqueeze(unsqueeze_dim) IndexError: index is out of bounds for dimension with size 0
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Python\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "D:\Python\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "D:\Python~OpenInterpreter\Scripts\interpreter.exe_main.py", line 7, in
Reproduce
Using LMstudio and Deepseekv2 GGUF,
1st prompt: perform simple analyse for C:\Data Sample.xlsx [basic dataset generated] 2nd prompt: perform visualization on the dataset
import pandas as pd
import matplotlib.pyplot as plt
data = pd.read_excel('C:\\Users\\Peter-Susan\\Desktop\\Data Sample.xlsx')
plt.figure(figsize=(10, 5))
plt.bar(data['LocID'], data['ASFR'])
plt.xlabel('Location ID')
plt.ylabel('Age Specific Fertility Rate (ASFR)')
plt.title('Bar Plot of ASFR by LocID')
plt.show()
Viewing image...
Expected behavior
A new windows pop up for visualization
Screenshots
Open Interpreter version
0.3.4
Python version
3.10.0
Operating System name and version
Windows 11
Additional context
No response
I want to fix this, can I be assigned for this
Same error (IndexError: index is out of bounds for dimension with size 0) here on MacOS 14.6.1 at every attempt to use vision capabilities with local models served by Ollama.
Any progress in fixing this issue? The error happens only after a matlibplot was requested and completed on my windows platform. Hope to see the issue solved soon. Thanks.
I'm having same issue.