# Requirements
!pip install -qU transformers accelerate bitsandbytes
# Imports & settingsfrom transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
import warnings
import os
os.environ["TOKENIZERS_PARALLELISM"] = "false"
warnings.filterwarnings('ignore')
# Model & Tokenizer
MODEL_NAME = "Kukedlc/Jupiter-k-7B-slerp"
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME, device_map='cuda:1', load_in_4bit=True)
tok = AutoTokenizer.from_pretrained(MODEL_NAME)
# Inference
prompt = "I want you to generate a theory that unites quantum mechanics with the theory of relativity and cosmic consciousness"
inputs = tok([prompt], return_tensors="pt").to('cuda')
streamer = TextStreamer(tok)
# Despite returning the usual output, the streamer will also print the generated text to stdout.
_ = model.generate(**inputs, streamer=streamer, max_new_tokens=512, do_sample=True, num_beams=1, top_p=0.9, temperature=0.7)
💻 Usage - Clasic
!pip install -qU transformers bitsandbytes accelerate
from transformers import AutoTokenizer
import transformers
import torch
model = "Kukedlc/Jupiter-k-7B-slerp"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
)
messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
print(outputs[0]["generated_text"])
Runs of Kukedlc Jupiter-k-7B-slerp on huggingface.co
58
Total runs
0
24-hour runs
-4
3-day runs
-4
7-day runs
-31
30-day runs
More Information About Jupiter-k-7B-slerp huggingface.co Model
Jupiter-k-7B-slerp huggingface.co is an AI model on huggingface.co that provides Jupiter-k-7B-slerp's model effect (), which can be used instantly with this Kukedlc Jupiter-k-7B-slerp model. huggingface.co supports a free trial of the Jupiter-k-7B-slerp model, and also provides paid use of the Jupiter-k-7B-slerp. Support call Jupiter-k-7B-slerp model through api, including Node.js, Python, http.
Jupiter-k-7B-slerp huggingface.co is an online trial and call api platform, which integrates Jupiter-k-7B-slerp's modeling effects, including api services, and provides a free online trial of Jupiter-k-7B-slerp, you can try Jupiter-k-7B-slerp online for free by clicking the link below.
Kukedlc Jupiter-k-7B-slerp online free url in huggingface.co:
Jupiter-k-7B-slerp is an open source model from GitHub that offers a free installation service, and any user can find Jupiter-k-7B-slerp on GitHub to install. At the same time, huggingface.co provides the effect of Jupiter-k-7B-slerp install, users can directly use Jupiter-k-7B-slerp installed effect in huggingface.co for debugging and trial. It also supports api for free installation.