Instructions to use Xssama/SMDM_SFT_GSM8K_clean with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Xssama/SMDM_SFT_GSM8K_clean with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Xssama/SMDM_SFT_GSM8K_clean")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Xssama/SMDM_SFT_GSM8K_clean", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Xssama/SMDM_SFT_GSM8K_clean with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Xssama/SMDM_SFT_GSM8K_clean" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xssama/SMDM_SFT_GSM8K_clean", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Xssama/SMDM_SFT_GSM8K_clean
- SGLang
How to use Xssama/SMDM_SFT_GSM8K_clean 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 "Xssama/SMDM_SFT_GSM8K_clean" \ --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": "Xssama/SMDM_SFT_GSM8K_clean", "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 "Xssama/SMDM_SFT_GSM8K_clean" \ --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": "Xssama/SMDM_SFT_GSM8K_clean", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Xssama/SMDM_SFT_GSM8K_clean with Docker Model Runner:
docker model run hf.co/Xssama/SMDM_SFT_GSM8K_clean
SMDM (Scaling up Masked Diffusion Models on Text)
This is the official implementation of the paper "Scaling up Masked Diffusion Models on Text" (https://arxiv.org/abs/2410.18514).
Model Description
SMDM is a family of masked diffusion models (MDMs) trained on the SlimPajama dataset. The models demonstrate competitive performance with autoregressive models (ARMs) while offering unique advantages in terms of bidirectional reasoning and temporal adaptation.
Key features:
- Scalable architecture with up to 1.1B parameters
- Unsupervised classifier-free guidance for better conditional inference
- Competitive performance on language understanding tasks
- Strong math reasoning capabilities
- Flexible trade-off between speed and quality in text generation
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model and tokenizer
model_name = "nieshen/SMDM" # Replace with your model name
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Generate text
input_text = "Once upon a time"
inputs = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**inputs, max_length=100)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(generated_text)
Training Details
The model was trained on the SlimPajama dataset using the following key components:
- Architecture: Masked Diffusion Model
- Training objective: Denoising diffusion
- Dataset: SlimPajama
- Hardware: Multiple GPUs
- Framework: PyTorch with Lightning
Evaluation
The model has been evaluated on various benchmarks:
- Language understanding tasks (HellaSwag, OpenBookQA, ARC-Easy, etc.)
- Math reasoning (GSM8K)
- Conditional generation (MT-Bench)
- Reverse curse tasks
- Temporal quality degradation
Citation
If you use this model, please cite our paper:
@article{smdm2024,
title={Scaling up Masked Diffusion Models on Text},
author={[Authors]},
journal={arXiv preprint arXiv:2410.18514},
year={2024}
}
License
This model is released under the Apache 2.0 license.
- Downloads last month
- 13