WeDLM-7B-Instruct
is an instruction-tuned diffusion language model that performs parallel decoding under standard causal attention, fine-tuned from
WeDLM-7B
.
from transformers import AutoTokenizer
from wedlm import LLM, SamplingParams
llm = LLM(model="tencent/WeDLM-7B-Instruct")
tokenizer = AutoTokenizer.from_pretrained("tencent/WeDLM-7B-Instruct", trust_remote_code=True)
prompt = "Explain the difference between machine learning and deep learning."
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = llm.generate([text], SamplingParams(temperature=0.2, max_tokens=512))
print(outputs[0]["text"])
Multi-turn Conversation
messages = [
{"role": "user", "content": "What is Python?"},
{"role": "assistant", "content": "Python is a high-level programming language known for its simplicity and readability."},
{"role": "user", "content": "Show me a hello world example."}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = llm.generate([text], SamplingParams(temperature=0.2, max_tokens=256))
WeDLM-7B-Instruct huggingface.co is an AI model on huggingface.co that provides WeDLM-7B-Instruct's model effect (), which can be used instantly with this tencent WeDLM-7B-Instruct model. huggingface.co supports a free trial of the WeDLM-7B-Instruct model, and also provides paid use of the WeDLM-7B-Instruct. Support call WeDLM-7B-Instruct model through api, including Node.js, Python, http.
WeDLM-7B-Instruct huggingface.co is an online trial and call api platform, which integrates WeDLM-7B-Instruct's modeling effects, including api services, and provides a free online trial of WeDLM-7B-Instruct, you can try WeDLM-7B-Instruct online for free by clicking the link below.
tencent WeDLM-7B-Instruct online free url in huggingface.co:
WeDLM-7B-Instruct is an open source model from GitHub that offers a free installation service, and any user can find WeDLM-7B-Instruct on GitHub to install. At the same time, huggingface.co provides the effect of WeDLM-7B-Instruct install, users can directly use WeDLM-7B-Instruct installed effect in huggingface.co for debugging and trial. It also supports api for free installation.