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

LLM HF Issue #8

Open
medhsv opened this issue Jul 6, 2024 · 1 comment
Open

LLM HF Issue #8

medhsv opened this issue Jul 6, 2024 · 1 comment

Comments

@medhsv
Copy link

medhsv commented Jul 6, 2024

AttributeError Traceback (most recent call last)
in <cell line: 102>()
100
101 # Create a HF LLM using the llama index wrapper
--> 102 llm = HuggingFaceLLM(context_window=2048,
103 max_new_tokens=256,
104 system_prompt=system_prompt,

/usr/local/lib/python3.10/dist-packages/llama_index/llms/huggingface/base.py in init(self, context_window, max_new_tokens, query_wrapper_prompt, tokenizer_name, model_name, model, tokenizer, device_map, stopping_ids, tokenizer_kwargs, tokenizer_outputs_to_remove, model_kwargs, generate_kwargs, is_chat_model, callback_manager, system_prompt, messages_to_prompt, completion_to_prompt, pydantic_program_mode, output_parser)
241
242 # check context_window
--> 243 config_dict = self._model.config.to_dict()
244 model_context_window = int(
245 config_dict.get("max_position_embeddings", context_window)

AttributeError: 'str' object has no attribute 'config'

@medhsv
Copy link
Author

medhsv commented Jul 6, 2024

this is where the issue is:

Create a HF LLM using the llama index wrapper

llm = HuggingFaceLLM(context_window=2048,
max_new_tokens=256,
system_prompt=system_prompt,
query_wrapper_prompt=query_wrapper_prompt,
model="meta-llama/Llama-2-7b-chat-hf",
tokenizer=tokenizer)

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

1 participant