Text Generation
Transformers
Safetensors
English
llama
text-generation-inference
LwQ
Llama3.1
conversational
Instructions to use prithivMLmods/LwQ-10B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/LwQ-10B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/LwQ-10B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/LwQ-10B-Instruct") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/LwQ-10B-Instruct", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use prithivMLmods/LwQ-10B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/LwQ-10B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/LwQ-10B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/LwQ-10B-Instruct
- SGLang
How to use prithivMLmods/LwQ-10B-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-10B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/LwQ-10B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-10B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "prithivMLmods/LwQ-10B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/LwQ-10B-Instruct with Docker Model Runner:
docker model run hf.co/prithivMLmods/LwQ-10B-Instruct
Update README.md
Browse files
README.md
CHANGED
|
@@ -11,3 +11,78 @@ tags:
|
|
| 11 |
---
|
| 12 |
|
| 13 |

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |

|
| 14 |
+
|
| 15 |
+
# **LwQ-10B-Instruct**
|
| 16 |
+
|
| 17 |
+
LwQ-10B-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 that utilizes 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-10B 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.
|
| 18 |
+
|
| 19 |
+
# **Use with transformers**
|
| 20 |
+
|
| 21 |
+
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.
|
| 22 |
+
|
| 23 |
+
Make sure to update your transformers installation via `pip install --upgrade transformers`.
|
| 24 |
+
|
| 25 |
+
```python
|
| 26 |
+
import transformers
|
| 27 |
+
import torch
|
| 28 |
+
|
| 29 |
+
model_id = "prithivMLmods/LwQ-10B-Instruct"
|
| 30 |
+
|
| 31 |
+
pipeline = transformers.pipeline(
|
| 32 |
+
"text-generation",
|
| 33 |
+
model=model_id,
|
| 34 |
+
model_kwargs={"torch_dtype": torch.bfloat16},
|
| 35 |
+
device_map="auto",
|
| 36 |
+
)
|
| 37 |
+
|
| 38 |
+
messages = [
|
| 39 |
+
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
|
| 40 |
+
{"role": "user", "content": "Who are you?"},
|
| 41 |
+
]
|
| 42 |
+
|
| 43 |
+
outputs = pipeline(
|
| 44 |
+
messages,
|
| 45 |
+
max_new_tokens=256,
|
| 46 |
+
)
|
| 47 |
+
print(outputs[0]["generated_text"][-1])
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
# **Intended Use**
|
| 51 |
+
|
| 52 |
+
1. **Multilingual Conversational Agents**:
|
| 53 |
+
LwQ-10B-Instruct is well-suited for building multilingual chatbots and virtual assistants, providing accurate and context-aware responses in various languages.
|
| 54 |
+
|
| 55 |
+
2. **Instruction-Following Applications**:
|
| 56 |
+
The model is ideal for tasks where adherence to specific instructions is critical, such as task automation, guided workflows, and structured content generation.
|
| 57 |
+
|
| 58 |
+
3. **Mathematical and Logical Reasoning**:
|
| 59 |
+
Trained on synthetic reasoning datasets, LwQ-10B can handle mathematical problem-solving, logical reasoning, and step-by-step explanations, making it suitable for education platforms and tutoring systems.
|
| 60 |
+
|
| 61 |
+
4. **Contextual Problem-Solving**:
|
| 62 |
+
The model is optimized for solving contextually rich problems by understanding and processing inputs with embedded instructions or keywords, useful for complex decision-making and recommendation systems.
|
| 63 |
+
|
| 64 |
+
5. **Content Creation and Summarization**:
|
| 65 |
+
LwQ-10B can generate high-quality content, including articles, reports, and summaries, across different languages and domains.
|
| 66 |
+
|
| 67 |
+
# **Limitations**
|
| 68 |
+
|
| 69 |
+
1. **Limited Context Window**:
|
| 70 |
+
The model has a finite context length, which may affect its ability to handle tasks requiring extensive context or long conversations effectively.
|
| 71 |
+
|
| 72 |
+
2. **Performance Variability Across Languages**:
|
| 73 |
+
While it supports multiple languages, performance may vary, with higher accuracy in languages that are better represented in the training data.
|
| 74 |
+
|
| 75 |
+
3. **Accuracy in Complex Reasoning**:
|
| 76 |
+
Despite being trained on reasoning datasets, the model may occasionally produce incorrect or incomplete answers for highly complex or multi-step reasoning tasks.
|
| 77 |
+
|
| 78 |
+
4. **Bias and Ethical Risks**:
|
| 79 |
+
Since the model is trained on large datasets from diverse sources, it may exhibit biases present in the training data, potentially leading to inappropriate or biased outputs.
|
| 80 |
+
|
| 81 |
+
5. **Dependency on Clear Instructions**:
|
| 82 |
+
The model’s ability to generate accurate outputs relies heavily on the clarity and specificity of user instructions. Ambiguous or vague instructions may result in suboptimal responses.
|
| 83 |
+
|
| 84 |
+
6. **Resource Requirements**:
|
| 85 |
+
As a large language model with 10 billion parameters, it requires significant computational resources for both training and inference, limiting its deployment in low-resource environments.
|
| 86 |
+
|
| 87 |
+
7. **Lack of Real-Time Understanding**:
|
| 88 |
+
LwQ-10B lacks real-time understanding of current events or data beyond its training, so it may not provide accurate responses for highly recent or dynamic information.
|