dvlab-research / Q-LLM

This is the official repo of "QuickLLaMA: Query-aware Inference Acceleration for Large Language Models"
https://arxiv.org/abs/2406.07528
38 stars 1 forks source link

question_ids如何设置? #1

Open MrXiaoaa opened 3 months ago

MrXiaoaa commented 3 months ago

您好,很有意思的工作,相比于之前的方法,增加了query的权重,十分符合逻辑。请问关于用户query的位置该如何设置,以参数形式传入model.generate()失败。

JulietLJY commented 3 months ago

我们定义了GreedySearch类,您可以定义searcher=GreedySearch(model, tokenizer)并用searcher.generate(question_ids=xxx)替代model.generate()

MrXiaoaa commented 3 months ago

谢谢,这是我的疏忽,您在原来的模型中增加了额外的变量作为question_ids的输入,而我直接调用了tansformer.models中的casuallm函数。经过修订后无异常。