Out-of-scope:
Use in any manner that violates applicable laws or regulations (including trade compliance laws).
Version:
1.0
Model Developers:
RedHatAI
This model is a quantized version of
sarvamai/sarvam-30b
.
It was evaluated on several tasks to assess its quality in comparison to the unquantized model.
Model Optimizations
This model was obtained by quantizing the weights and activations of
sarvamai/sarvam-30b
to FP8 data type, ready for inference with vLLM.
Only the weights and activations of the linear operators within transformers blocks are quantized using
LLM Compressor
.
Deployment
Use with vLLM
This model can be deployed efficiently using the
vLLM
backend.
from compressed_tensors.offload import dispatch_model
from transformers import AutoModelForCausalLM, AutoTokenizer
from llmcompressor import oneshot
from llmcompressor.modifiers.quantization import QuantizationModifier
MODEL_ID = "sarvamai/sarvam-30b"# Load model.
model = AutoModelForCausalLM.from_pretrained(MODEL_ID, dtype="auto", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
# Configure the quantization algorithm and scheme.# In this case, we:# * quantize the weights to fp8 with per channel via ptq# * quantize the activations to fp8 with dynamic per token
recipe = QuantizationModifier(
targets="Linear", scheme="FP8_DYNAMIC", ignore=["lm_head"]
)
# Apply quantization.
oneshot(model=model, recipe=recipe)
# Confirm generations of the quantized model look sane.print("========== SAMPLE GENERATION ==============")
dispatch_model(model)
input_ids = tokenizer("Hello my name is", return_tensors="pt").input_ids.to(
model.device
)
output = model.generate(input_ids, max_new_tokens=20)
print(tokenizer.decode(output[0]))
print("==========================================")
# Save to disk in compressed-tensors format.
SAVE_DIR = MODEL_ID.rstrip("/").split("/")[-1] + "-FP8-Dynamic"
model.save_pretrained(SAVE_DIR)
tokenizer.save_pretrained(SAVE_DIR)
sarvam-30b-FP8-dynamic huggingface.co is an AI model on huggingface.co that provides sarvam-30b-FP8-dynamic's model effect (), which can be used instantly with this RedHatAI sarvam-30b-FP8-dynamic model. huggingface.co supports a free trial of the sarvam-30b-FP8-dynamic model, and also provides paid use of the sarvam-30b-FP8-dynamic. Support call sarvam-30b-FP8-dynamic model through api, including Node.js, Python, http.
sarvam-30b-FP8-dynamic huggingface.co is an online trial and call api platform, which integrates sarvam-30b-FP8-dynamic's modeling effects, including api services, and provides a free online trial of sarvam-30b-FP8-dynamic, you can try sarvam-30b-FP8-dynamic online for free by clicking the link below.
RedHatAI sarvam-30b-FP8-dynamic online free url in huggingface.co:
sarvam-30b-FP8-dynamic is an open source model from GitHub that offers a free installation service, and any user can find sarvam-30b-FP8-dynamic on GitHub to install. At the same time, huggingface.co provides the effect of sarvam-30b-FP8-dynamic install, users can directly use sarvam-30b-FP8-dynamic installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
sarvam-30b-FP8-dynamic install url in huggingface.co: