Text Generation
Transformers
Safetensors
llama
text-generation-inference
Llama
Code
CoT
Math
Deepsync
3b
conversational
Instructions to use prithivMLmods/Llama-Deepsync-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use prithivMLmods/Llama-Deepsync-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="prithivMLmods/Llama-Deepsync-1B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("prithivMLmods/Llama-Deepsync-1B") model = AutoModelForCausalLM.from_pretrained("prithivMLmods/Llama-Deepsync-1B") 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/Llama-Deepsync-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "prithivMLmods/Llama-Deepsync-1B" # 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/Llama-Deepsync-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/prithivMLmods/Llama-Deepsync-1B
- SGLang
How to use prithivMLmods/Llama-Deepsync-1B 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/Llama-Deepsync-1B" \ --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/Llama-Deepsync-1B", "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/Llama-Deepsync-1B" \ --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/Llama-Deepsync-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use prithivMLmods/Llama-Deepsync-1B with Docker Model Runner:
docker model run hf.co/prithivMLmods/Llama-Deepsync-1B
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
| 1 |
---
|
| 2 |
license: creativeml-openrail-m
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
<pre align="center">
|
| 5 |
.___ _______.
|
|
@@ -8,4 +23,80 @@ license: creativeml-openrail-m
|
|
| 8 |
/ /_/ \ ___/\ ___/| |_> >___ \ \___ | | \ \___ | || \_\ \
|
| 9 |
\____ |\___ >\___ > __/____ >/ ____|___| /\___ > |___||___ /
|
| 10 |
\/ \/ \/|__| \/ \/ \/ \/ \/
|
| 11 |
-
</pre>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: creativeml-openrail-m
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
- de
|
| 6 |
+
- fr
|
| 7 |
+
- it
|
| 8 |
+
- pt
|
| 9 |
+
- hi
|
| 10 |
+
- es
|
| 11 |
+
- th
|
| 12 |
+
base_model:
|
| 13 |
+
- meta-llama/Llama-3.2-1B-Instruct
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
+
tags:
|
| 16 |
+
- text-generation-inference
|
| 17 |
+
library_name: transformers
|
| 18 |
---
|
| 19 |
<pre align="center">
|
| 20 |
.___ _______.
|
|
|
|
| 23 |
/ /_/ \ ___/\ ___/| |_> >___ \ \___ | | \ \___ | || \_\ \
|
| 24 |
\____ |\___ >\___ > __/____ >/ ____|___| /\___ > |___||___ /
|
| 25 |
\/ \/ \/|__| \/ \/ \/ \/ \/
|
| 26 |
+
</pre>
|
| 27 |
+
|
| 28 |
+
The **Llama-Deepsync-1B** is a fine-tuned version of the **Llama-3.2-1B-Instruct** base model, designed for text generation tasks that require deep reasoning, logical structuring, and problem-solving. This model leverages its optimized architecture to provide accurate and contextually relevant outputs for complex queries, making it ideal for applications in education, programming, and creative writing.
|
| 29 |
+
|
| 30 |
+
With its robust natural language processing capabilities, **Llama-Deepsync-1B** excels in generating step-by-step solutions, creative content, and logical analyses. Its architecture integrates advanced understanding of both structured and unstructured data, ensuring precise text generation aligned with user inputs.
|
| 31 |
+
|
| 32 |
+
- Significantly **more knowledge** and has greatly improved capabilities in **coding** and **mathematics**, thanks to our specialized expert models in these domains.
|
| 33 |
+
- Significant improvements in **instruction following**, **generating long texts** (over 8K tokens), **understanding structured data** (e.g, tables), and **generating structured outputs** especially JSON. **More resilient to the diversity of system prompts**, enhancing role-play implementation and condition-setting for chatbots.
|
| 34 |
+
- **Long-context Support** up to 128K tokens and can generate up to 8K tokens.
|
| 35 |
+
- **Multilingual support** for over 29 languages, including Chinese, English, French, Spanish, Portuguese, German, Italian, Russian, Japanese, Korean, Vietnamese, Thai, Arabic, and more.
|
| 36 |
+
|
| 37 |
+
# **Model Architecture**
|
| 38 |
+
|
| 39 |
+
Llama 3.2 is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align with human preferences for helpfulness and safety.
|
| 40 |
+
|
| 41 |
+
# **Use with transformers**
|
| 42 |
+
|
| 43 |
+
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.
|
| 44 |
+
|
| 45 |
+
Make sure to update your transformers installation via `pip install --upgrade transformers`.
|
| 46 |
+
|
| 47 |
+
```python
|
| 48 |
+
import torch
|
| 49 |
+
from transformers import pipeline
|
| 50 |
+
|
| 51 |
+
model_id = "prithivMLmods/Llama-Deepsync-1B"
|
| 52 |
+
pipe = pipeline(
|
| 53 |
+
"text-generation",
|
| 54 |
+
model=model_id,
|
| 55 |
+
torch_dtype=torch.bfloat16,
|
| 56 |
+
device_map="auto",
|
| 57 |
+
)
|
| 58 |
+
messages = [
|
| 59 |
+
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
|
| 60 |
+
{"role": "user", "content": "Who are you?"},
|
| 61 |
+
]
|
| 62 |
+
outputs = pipe(
|
| 63 |
+
messages,
|
| 64 |
+
max_new_tokens=256,
|
| 65 |
+
)
|
| 66 |
+
print(outputs[0]["generated_text"][-1])
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Note: You can also find detailed recipes on how to use the model locally, with `torch.compile()`, assisted generations, quantised and more at [`huggingface-llama-recipes`](https://github.com/huggingface/huggingface-llama-recipes)
|
| 70 |
+
|
| 71 |
+
# **Run with Ollama [Ollama Run]**
|
| 72 |
+
|
| 73 |
+
Ollama makes running machine learning models simple and efficient. Follow these steps to set up and run your GGUF models quickly.
|
| 74 |
+
|
| 75 |
+
## Quick Start: Step-by-Step Guide
|
| 76 |
+
|
| 77 |
+
| Step | Description | Command / Instructions |
|
| 78 |
+
|------|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
|
| 79 |
+
| 1 | **Install Ollama 🦙** | Download Ollama from [https://ollama.com/download](https://ollama.com/download) and install it on your system. |
|
| 80 |
+
| 2 | **Create Your Model File** | - Create a file named after your model, e.g., `metallama`. |
|
| 81 |
+
| | | - Add the following line to specify the base model: |
|
| 82 |
+
| | | ```bash |
|
| 83 |
+
| | | FROM Llama-3.2-1B.F16.gguf |
|
| 84 |
+
| | | ``` |
|
| 85 |
+
| | | - Ensure the base model file is in the same directory. |
|
| 86 |
+
| 3 | **Create and Patch the Model** | Run the following commands to create and verify your model: |
|
| 87 |
+
| | | ```bash |
|
| 88 |
+
| | | ollama create metallama -f ./metallama |
|
| 89 |
+
| | | ollama list |
|
| 90 |
+
| | | ``` |
|
| 91 |
+
| 4 | **Run the Model** | Use the following command to start your model: |
|
| 92 |
+
| | | ```bash |
|
| 93 |
+
| | | ollama run metallama |
|
| 94 |
+
| | | ``` |
|
| 95 |
+
| 5 | **Interact with the Model** | Once the model is running, interact with it: |
|
| 96 |
+
| | | ```plaintext |
|
| 97 |
+
| | | >>> Tell me about Space X. |
|
| 98 |
+
| | | Space X, the private aerospace company founded by Elon Musk, is revolutionizing space exploration... |
|
| 99 |
+
| | | ``` |
|
| 100 |
+
|
| 101 |
+
## Conclusion
|
| 102 |
+
With Ollama, running and interacting with models is seamless. Start experimenting today!
|