Text Generation
Transformers
PyTorch
English
mor_llama
adaptive-computation
early-exiting
llama
language-model
efficient-inference
custom_code
Instructions to use sudeshmu/fine_tune with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sudeshmu/fine_tune with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sudeshmu/fine_tune", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("sudeshmu/fine_tune", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sudeshmu/fine_tune with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sudeshmu/fine_tune" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sudeshmu/fine_tune", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sudeshmu/fine_tune
- SGLang
How to use sudeshmu/fine_tune 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 "sudeshmu/fine_tune" \ --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": "sudeshmu/fine_tune", "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 "sudeshmu/fine_tune" \ --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": "sudeshmu/fine_tune", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sudeshmu/fine_tune with Docker Model Runner:
docker model run hf.co/sudeshmu/fine_tune
Update README.md
Browse fileschanged to fine_tune as its not mor
README.md
CHANGED
|
@@ -2,7 +2,6 @@
|
|
| 2 |
license: mit
|
| 3 |
library_name: transformers
|
| 4 |
tags:
|
| 5 |
-
- mixture-of-recursions
|
| 6 |
- adaptive-computation
|
| 7 |
- early-exiting
|
| 8 |
- llama
|
|
@@ -17,26 +16,13 @@ pipeline_tag: text-generation
|
|
| 17 |
model_type: llama
|
| 18 |
---
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
<div align="center">
|
| 23 |
-
|
| 24 |
-
[](https://arxiv.org/abs/2507.10524)
|
| 25 |
-
[](https://github.com/raymin0223/mixture_of_recursions)
|
| 26 |
-
[](https://opensource.org/licenses/MIT)
|
| 27 |
|
| 28 |
</div>
|
| 29 |
|
| 30 |
## Model Description
|
| 31 |
|
| 32 |
-
This is a **Mixture-of-Recursions (MoR)** model that implements adaptive token-level computation through dynamic recursive depths. MoR addresses key bottlenecks in early-exiting techniques by introducing a unified framework that tackles both missing Key-Value (KV) cache problems and inefficient batched inference.
|
| 33 |
|
| 34 |
-
**Key Features:**
|
| 35 |
-
- 🚀 **Up to 2× greater inference throughput** compared to standard transformers at similar accuracy
|
| 36 |
-
- 🧠 **Dynamic routing mechanism** that assigns optimal recursion depth to each token
|
| 37 |
-
- 💾 **Recursion-wise KV caching strategy** that optimizes memory usage
|
| 38 |
-
- ⚡ **Efficient batched inference** through parameter sharing
|
| 39 |
-
- 🎯 **End-to-end trainable** architecture
|
| 40 |
|
| 41 |
### Model Details
|
| 42 |
|
|
@@ -64,7 +50,7 @@ import torch
|
|
| 64 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 65 |
|
| 66 |
# Load model and tokenizer
|
| 67 |
-
model_name = "your-username/
|
| 68 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 69 |
model = AutoModelForCausalLM.from_pretrained(
|
| 70 |
model_name,
|
|
|
|
| 2 |
license: mit
|
| 3 |
library_name: transformers
|
| 4 |
tags:
|
|
|
|
| 5 |
- adaptive-computation
|
| 6 |
- early-exiting
|
| 7 |
- llama
|
|
|
|
| 16 |
model_type: llama
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# Model Fine tunning on ineweb-edu-dedup, Hugging face open datasets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
</div>
|
| 22 |
|
| 23 |
## Model Description
|
| 24 |
|
|
|
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
### Model Details
|
| 28 |
|
|
|
|
| 50 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 51 |
|
| 52 |
# Load model and tokenizer
|
| 53 |
+
model_name = "your-username/fine_tune"
|
| 54 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 55 |
model = AutoModelForCausalLM.from_pretrained(
|
| 56 |
model_name,
|