Instructions to use aframson/RDPDLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use aframson/RDPDLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="aframson/RDPDLM", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("aframson/RDPDLM", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use aframson/RDPDLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "aframson/RDPDLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "aframson/RDPDLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/aframson/RDPDLM
- SGLang
How to use aframson/RDPDLM 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 "aframson/RDPDLM" \ --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": "aframson/RDPDLM", "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 "aframson/RDPDLM" \ --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": "aframson/RDPDLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use aframson/RDPDLM with Docker Model Runner:
docker model run hf.co/aframson/RDPDLM
File size: 1,253 Bytes
5376a3f a3d0dbb 5376a3f 99a7249 5376a3f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
from transformers import PretrainedConfig ,PreTrainedTokenizer
class OBIConfig(PretrainedConfig):
def __init__(self,
model_type="OBILanguageModel",
auto_map={
"AutoConfig": "modelConfig.OBIConfig",
"AutoModel": "modelLM.OBILanguageModel",
"AutoModelForCausalLM": "modelLM.OBILanguageModel",
"AutoModelForQuestionAnswering": "modelLM.OBILanguageModel"
},
vocab_size=1000,
hidden_size=4,
num_attention_heads=2,
num_hidden_layers=2,
hidden_dropout_prob=0.1,
block_size=100,
batch_size=60,
max_iters=200,
eval_interval=100,
learning_rate=0.001,
device="cpu",
**kwargs
)->None:
super().__init__(**kwargs)
self.model_type = model_type
self.auto_map = auto_map
self.vocab_size = vocab_size
self.hidden_size = hidden_size
self.num_attention_heads = num_attention_heads
self.num_hidden_layers = num_hidden_layers
self.hidden_dropout_prob = hidden_dropout_prob
self.block_size = block_size
self.batch_size = batch_size
self.max_iters = max_iters
self.eval_interval = eval_interval
self.learning_rate = learning_rate
self.device = device
|