my-quantized-llm

This is a quantized version of an LLM model, optimized for efficient inference.

Model Details

  • Quantization: 4-bit or 8-bit using bitsandbytes
  • Framework: Transformers
  • Use Case: Text generation with reduced memory footprint

Usage

Load the model locally

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

model_name = "iduryodhanrao/my-quantized-llm"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    device_map="auto",
    trust_remote_code=True
)

prompt = "Hello, how are you?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))

Inference API

You can also use the Hugging Face Inference API:

import requests

API_URL = "https://api-inference.huggingface.co/models/iduryodhanrao/my-quantized-llm"
headers = {"Authorization": "Bearer YOUR_HF_TOKEN"}

def query(payload):
    response = requests.post(API_URL, headers=headers, json=payload)
    return response.json()

output = query({"inputs": "The future of AI is"})
print(output)

Limitations

  • This model is quantized and may have slightly reduced accuracy compared to the original model
  • Designed for efficient inference rather than fine-tuning

License

Licensed under Apache 2.0

Downloads last month
10
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
U8
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support