We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
这个问题回答是空的 prompt = "// language: Java\n //Write a class with fields for name, ID, age, address, and company\n"
from transformers import AutoTokenizer, AutoModel model_path="/home/ubuntu/model_test/THUDM/codegeex2-6b" tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True) model = AutoModel.from_pretrained(model_path, trust_remote_code=True, device='cuda') model = model.eval() prompt = "// language: Java\n //Write a class with fields for name, ID, age, address, and company\n" inputs = tokenizer.encode(prompt, return_tensors="pt").to(model.device) outputs = model.generate(inputs, max_length=256, top_k=1) response = tokenizer.decode(outputs[0]) print("response") print(response)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
这个问题回答是空的
prompt = "// language: Java\n //Write a class with fields for name, ID, age, address, and company\n"
The text was updated successfully, but these errors were encountered: