NVIDIA / ChatRTX

A developer reference project for creating Retrieval Augmented Generation (RAG) chatbots on Windows using TensorRT-LLM
Other
2.76k stars 339 forks source link

AssertionError: Config has to be initialized with question_encoder and generator config #79

Open itsnotjoe opened 4 months ago

itsnotjoe commented 4 months ago

When I tried to launch ChatRTX with verifyinstall and app.py, there is always an assertion error: AssertionError: Config has to be initialized with question_encoder and generator config

I've already check twice on all the things I've downloaded, as well as checking the website of Huggingface for help but to no avail. Here are the logs

Traceback (most recent call last):
  File "C:\trt-llm-rag-windows\app.py", line 239, in <module>
    embed_model = HuggingFaceEmbeddings(model_name=embedded_model)
  File "C:\Users\username\ChatRTX\lib\site-packages\langchain_community\embeddings\huggingface.py", line 72, in __init__
    self.client = sentence_transformers.SentenceTransformer(
  File "C:\Users\username\ChatRTX\lib\site-packages\sentence_transformers\SentenceTransformer.py", line 95, in __init__
    modules = self._load_sbert_model(model_path)
  File "C:\Users\username\ChatRTX\lib\site-packages\sentence_transformers\SentenceTransformer.py", line 840, in _load_sbert_model
    module = module_class.load(os.path.join(model_path, module_config['path']))
  File "C:\Users\username\ChatRTX\lib\site-packages\sentence_transformers\models\Transformer.py", line 137, in load
    return Transformer(model_name_or_path=input_path, **config)
  File "C:\Users\username\ChatRTX\lib\site-packages\sentence_transformers\models\Transformer.py", line 28, in __init__
    config = AutoConfig.from_pretrained(model_name_or_path, **model_args, cache_dir=cache_dir)
  File "C:\Users\username\ChatRTX\lib\site-packages\transformers\models\auto\configuration_auto.py", line 1141, in from_pretrained
    return CONFIG_MAPPING[pattern].from_dict(config_dict, **unused_kwargs)
  File "C:\Users\username\ChatRTX\lib\site-packages\transformers\configuration_utils.py", line 763, in from_dict
    config = cls(**config_dict)
  File "C:\Users\username\ChatRTX\lib\site-packages\transformers\models\rag\configuration_rag.py", line 133, in __init__
    "question_encoder" in kwargs and "generator" in kwargs

AssertionError: Config has to be initialized with question_encoder and generator config