LLM 生成问题 - 只返回乱码?

问题描述 投票:0回答:1

我正在尝试使用 HuggingfaceLLM 类将模型从路径加载到 llamaindex 中,如下所示:

from llama_index.llms.huggingface import HuggingFaceLLM

llm = HuggingFaceLLM(
   context_window=2048,
   max_new_tokens=300,
   generate_kwargs={"temperature": 0.5, "do_sample": True},
   #query_wrapper_prompt=query_wrapper_prompt,
   tokenizer_name="local_path/leo-hessianai-7B-AWQ",
   model_name="local_path/leo-hessianai-7B-AWQ",
   device_map="auto"
)

文件夹是从huggingface-hub下载的,模型正在加载,但是,当我查询它时,它只返回乱码(比如hohohohohohohohohohohohohoho等)

源节点是合理且正确的,我检查过,只有生成部分似乎是错误的。

我这里有什么遗漏的吗?当我使用链接从集线器加载模型时,这很好,但这在 IDE 中不起作用(Ollama 等也不是一个选项)。

我感谢任何帮助,谢谢!

large-language-model huggingface llama-index
1个回答
0
投票

此模型不是常规模型,它具有自定义量化方案,您正在使用的库可能不支持该方案。看 https://huggingface.co/TheBloke/leo-hessianai-7B-AWQ#about-awq

确实,在 vllm 示例中,他们指定了量化 https://huggingface.co/TheBloke/leo-hessianai-7B-AWQ#serving-this-model-from-vllm

不确定 llama 指数是什么,但如果我是你,我会尝试不同的模型

© www.soinside.com 2019 - 2024. All rights reserved.