import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("stabilityai/stable-code-instruct-3b", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("stabilityai/stable-code-instruct-3b", torch_dtype=torch.bfloat16, trust_remote_code=True)
model.eval()
model = model.cuda()
messages = [
{
"role": "system",
"content": "You are a helpful and polite assistant",
},
{
"role": "user",
"content": "Write a simple website in HTML. When a user clicks the button, it shows a random joke from a list of 4 jokes."
},
]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
inputs = tokenizer([prompt], return_tensors="pt").to(model.device)
tokens = model.generate(
**inputs,
max_new_tokens=1024,
temperature=0.5,
top_p=0.95,
top_k=100,
do_sample=True,
use_cache=True
)
output = tokenizer.batch_decode(tokens[:, inputs.input_ids.shape[-1]:], skip_special_tokens=False)[0]
Runs of duyntnet stable-code-instruct-3b-imatrix-GGUF on huggingface.co
1.0K
Total runs
0
24-hour runs
-92
3-day runs
-146
7-day runs
-25
30-day runs
More Information About stable-code-instruct-3b-imatrix-GGUF huggingface.co Model
More stable-code-instruct-3b-imatrix-GGUF license Visit here:
stable-code-instruct-3b-imatrix-GGUF huggingface.co is an AI model on huggingface.co that provides stable-code-instruct-3b-imatrix-GGUF's model effect (), which can be used instantly with this duyntnet stable-code-instruct-3b-imatrix-GGUF model. huggingface.co supports a free trial of the stable-code-instruct-3b-imatrix-GGUF model, and also provides paid use of the stable-code-instruct-3b-imatrix-GGUF. Support call stable-code-instruct-3b-imatrix-GGUF model through api, including Node.js, Python, http.
stable-code-instruct-3b-imatrix-GGUF huggingface.co is an online trial and call api platform, which integrates stable-code-instruct-3b-imatrix-GGUF's modeling effects, including api services, and provides a free online trial of stable-code-instruct-3b-imatrix-GGUF, you can try stable-code-instruct-3b-imatrix-GGUF online for free by clicking the link below.
duyntnet stable-code-instruct-3b-imatrix-GGUF online free url in huggingface.co:
stable-code-instruct-3b-imatrix-GGUF is an open source model from GitHub that offers a free installation service, and any user can find stable-code-instruct-3b-imatrix-GGUF on GitHub to install. At the same time, huggingface.co provides the effect of stable-code-instruct-3b-imatrix-GGUF install, users can directly use stable-code-instruct-3b-imatrix-GGUF installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
stable-code-instruct-3b-imatrix-GGUF install url in huggingface.co: