ChatGLM-6B icon indicating copy to clipboard operation
ChatGLM-6B copied to clipboard

[BUG/Help] prompt让模型简要回答,模型太过固执就是不干

Open bob-dingli-abb opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current Behavior

公司名为“椰子奶茶公司”是一个不错的选择。

Expected Behavior

椰子奶茶公司

Steps To Reproduce

使用restful api创建了chatglm的模型类 在prompt中让他只需要回答一个名字就可以了,怎么尝试都无法实现。 像这种带废话的回答,如何实现prompt chain? 感觉训练数据集的废话太多了

from langchain.prompts import PromptTemplate from chatglm import ChatGLM

llm = ChatGLM() prompt = PromptTemplate( input_variables=["product"], template="I want you to act as a naming consultant for new companies. You will provide one name without any reason and without the prefix like “公司名为” and also please simply the answer. What is a good name for a company that makes {product}? Answer in Chinese",

)

from langchain.chains import LLMChain chain = LLMChain(llm=llm, prompt=prompt)

Run the chain only specifying the input variable.

print(chain.run("椰子奶茶"))

Environment

- OS:win10
- Python:3.10.11
- Transformers:
- PyTorch:
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

Anything else?

No response

bob-dingli-abb avatar May 06 '23 01:05 bob-dingli-abb

+1 尝试用prompt控制输出,基本无效的,有效的时候就像中奖一样,大概是模型的问题,不知道作者能不能确认一下。

flaviadeutsch avatar May 06 '23 10:05 flaviadeutsch

+1 尝试用prompt控制输出,基本无效的,有效的时候就像中奖一样,大概是模型的问题,不知道作者能不能确认一下。

怎么用prompt去控制呢 在哪设置

sssssshf avatar May 10 '23 07:05 sssssshf

+1

ycjcl868 avatar Jul 25 '23 03:07 ycjcl868

可以降低temperature试一下

dengdengdeng1 avatar Aug 01 '23 08:08 dengdengdeng1