InternLM / lagent

A lightweight framework for building LLM-based agents
Apache License 2.0
1.75k stars 178 forks source link

AttributeError: 'GenerationConfig' object has no attribute '_eos_token_tensor' #244

Open jamiechoi1995 opened 2 weeks ago

jamiechoi1995 commented 2 weeks ago
Traceback (most recent call last):
  File "/data/anaconda3/envs/torch/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
    result = func()
             ^^^^^^
  File "/data/anaconda3/envs/torch/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec
    exec(code, module.__dict__)
  File "/data/github/lagent/examples/internlm2_agent_web_demo_hf.py", line 332, in <module>
    main()
  File "/data/github/lagent/examples/internlm2_agent_web_demo_hf.py", line 285, in main
    for agent_return in st.session_state['chatbot'].stream_chat(
  File "/data/anaconda3/envs/torch/lib/python3.11/site-packages/lagent/agents/internlm2_agent.py", line 303, in stream_chat
    for model_state, res, _ in self._llm.stream_chat(prompt, **kwargs):
  File "/data/anaconda3/envs/torch/lib/python3.11/site-packages/lagent/llms/huggingface.py", line 292, in stream_chat
    yield from self.stream_generate(prompt, do_sample, **kwargs)
  File "/data/anaconda3/envs/torch/lib/python3.11/site-packages/lagent/llms/huggingface.py", line 197, in stream_generate
    logits_processor = self.model._get_logits_processor(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/data/anaconda3/envs/torch/lib/python3.11/site-packages/transformers/generation/utils.py", line 866, in _get_logits_processor
    and generation_config._eos_token_tensor is not None
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GenerationConfig' object has no attribute '_eos_token_tensor'
EvoNexusX commented 4 days ago

同样的错误