GAIR-NLP / anole

Anole: An Open, Autoregressive and Native Multimodal Models for Interleaved Image-Text Generation
https://huggingface.co/spaces/ethanchern/Anole
615 stars 33 forks source link

AttributeError: 'ChameleonInferenceModel' object has no attribute 'dctx' #22

Closed vaisax closed 1 month ago

vaisax commented 1 month ago
(multimodal) administrator@admin:~/Desktop/LLM/anole_model/anole$ python inference.py -i input.json
Traceback (most recent call last):
  File "/home/administrator/Desktop/LLM/anole_model/anole/inference.py", line 129, in <module>
    main(args)
  File "/home/administrator/Desktop/LLM/anole_model/anole/inference.py", line 67, in main
    model = ChameleonInferenceModel(
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/administrator/Desktop/LLM/anole_model/anole/chameleon/inference/chameleon.py", line 545, in __init__
    self.token_manager = TokenManager(
                         ^^^^^^^^^^^^^
  File "/home/administrator/Desktop/LLM/anole_model/anole/chameleon/inference/chameleon.py", line 99, in __init__
    self.tokenizer = Tokenizer.from_file(tokenizer_path)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: No such file or directory (os error 2)
Exception ignored in: <function ChameleonInferenceModel.__del__ at 0x7ff80a9ad3a0>
Traceback (most recent call last):
  File "/home/administrator/Desktop/LLM/anole_model/anole/chameleon/inference/chameleon.py", line 573, in __del__
    with self.dctx.active_key_lock:
         ^^^^^^^^^
tellsiddh commented 1 month ago
    def __del__(self):
        try:
            if self.dctx:
                with self.dctx.active_key_lock:
                    self.dctx.active_key.clear()
                self.dctx.req_q.put([None, None, None, True])
                for w in self.workers:
                    w.join()
        except AttributeError:
            pass 
        except FileNotFoundError:
            pass

Adding this check fixed that issue

Add here - File "/home/administrator/Desktop/LLM/anole_model/anole/chameleon/inference/chameleon.py", line 573

JoyBoy-Su commented 1 month ago

Hi, did you solve this problem? If not, you can check the path and directory structure of the model.