Instructions to use prithivMLmods/LwQ-30B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/LwQ-30B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/LwQ-30B-Instruct")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/LwQ-30B-Instruct") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/LwQ-30B-Instruct") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use prithivMLmods/LwQ-30B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/LwQ-30B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/LwQ-30B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/prithivMLmods/LwQ-30B-Instruct
- SGLang
How to use prithivMLmods/LwQ-30B-Instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "prithivMLmods/LwQ-30B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/LwQ-30B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "prithivMLmods/LwQ-30B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/LwQ-30B-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use prithivMLmods/LwQ-30B-Instruct with Docker Model Runner:
docker model run hf.co/prithivMLmods/LwQ-30B-Instruct
LwQ-30B-Instruct
LwQ-30B-Instruct (Llama with Questions), based on the Llama 3.1 collection of multilingual large language models (LLMs), is a set of pre-trained and instruction-tuned generative models optimized for multilingual dialogue use cases. These models outperform many available open-source alternatives. Model Architecture: Llama 3.1 is an auto-regressive language model utilizing an optimized transformer architecture. The tuned versions undergo supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to better align with human preferences for helpfulness and safety. LwQ-30B is trained on synthetic reasoning datasets for mathematical reasoning and context-based problem-solving, with a focus on following instructions or keywords embedded in the input.
Use with transformers
Starting with transformers >= 4.43.0 onward, you can run conversational inference using the Transformers pipeline abstraction or by leveraging the Auto classes with the generate() function.
Make sure to update your transformers installation via pip install --upgrade transformers.
import transformers
import torch
model_id = "prithivMLmods/LwQ-30B-Instruct"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
{"role": "user", "content": "Who are you?"},
]
outputs = pipeline(
messages,
max_new_tokens=256,
)
print(outputs[0]["generated_text"][-1])
Intended Use
Multilingual Dialogue Systems: LwQ-30B-Instruct is designed for creating conversational agents capable of engaging in dialogues across multiple languages, making it suitable for global customer support and multilingual chatbots.
Instruction-Following Tasks: The model excels at tasks requiring adherence to specific instructions or keywords embedded in the input, such as form completion, task automation, and guided workflows.
Mathematical Reasoning: With specialized training on synthetic reasoning datasets, LwQ-30B can perform complex mathematical reasoning and problem-solving, making it useful for educational platforms, tutoring systems, and research assistance.
Context-Based Problem Solving: The model is optimized to handle contextually rich problems, allowing it to generate context-aware responses for applications such as summarization, question answering, and decision support.
Content Generation: It can generate high-quality content, including articles, reports, summaries, and creative writing, across various domains and languages.
Knowledge Retrieval: LwQ-30B can retrieve and synthesize information from its trained data to answer factual questions, assist in research, and support knowledge-intensive tasks.
Limitations
Performance Variability Across Languages: While the model supports multiple languages, its performance may vary depending on the language, with better results for languages more prevalent in its training data.
Handling of Niche Topics: The model may struggle to provide accurate information or generate high-quality content for highly specialized or niche topics not covered extensively in its training data.
Complex Multi-Step Reasoning: Although trained on reasoning datasets, the model may still occasionally produce incorrect or incomplete results for multi-step or highly complex reasoning tasks.
Bias and Ethical Concerns: Since LwQ-30B is trained on large, publicly available datasets, it may inherit biases present in the data, leading to potential ethical concerns or inappropriate outputs in certain contexts.
Context Limitations: The model has a finite context window, which may lead to incomplete understanding or response generation for tasks requiring extensive context or very long input texts.
Resource Intensive: As a large-scale model with 30 billion parameters, it requires substantial computational resources for both inference and deployment, limiting its use in resource-constrained environments.
Instruction Ambiguity: The modelβs performance can degrade when instructions are ambiguous, vague, or conflicting, potentially leading to outputs that do not align with user expectations.
- Downloads last month
- 5
