Instructions to use deqing/lstm-window-4-v5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use deqing/lstm-window-4-v5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="deqing/lstm-window-4-v5", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("deqing/lstm-window-4-v5", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use deqing/lstm-window-4-v5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "deqing/lstm-window-4-v5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "deqing/lstm-window-4-v5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/deqing/lstm-window-4-v5
- SGLang
How to use deqing/lstm-window-4-v5 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 "deqing/lstm-window-4-v5" \ --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": "deqing/lstm-window-4-v5", "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 "deqing/lstm-window-4-v5" \ --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": "deqing/lstm-window-4-v5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use deqing/lstm-window-4-v5 with Docker Model Runner:
docker model run hf.co/deqing/lstm-window-4-v5
| { | |
| "embed_dim": 1024, | |
| "hidden_size": 1024, | |
| "num_layers": 4, | |
| "lstm_dropout": 0.1, | |
| "no_tie_embeddings": false, | |
| "base_model": "meta-llama/Llama-3.2-1B", | |
| "dataset_name": "HuggingFaceFW/fineweb-edu", | |
| "dataset_config": "sample-10BT", | |
| "local_data_path": null, | |
| "text_column": "text", | |
| "train_samples": null, | |
| "val_samples": 500, | |
| "mode": "window", | |
| "window_size": 4, | |
| "batch_size": 16, | |
| "grad_accum": 16, | |
| "epochs": 1, | |
| "lr": 0.001, | |
| "min_lr_ratio": 0.1, | |
| "warmup_steps": 500, | |
| "weight_decay": 0.01, | |
| "adam_beta2": 0.95, | |
| "eval_steps": 500, | |
| "save_steps": 1000, | |
| "context_length": 1024, | |
| "num_dataloader_workers": 0, | |
| "gradient_checkpointing": false, | |
| "chunk_data": true, | |
| "chunk_num_proc": null, | |
| "chunk_batch_size": 1000, | |
| "output_dir": "/scratch1/deqingfu/checkpoints/fourier_emergence_fineweb-edu_sample-10BT_300M_v5/lstm_window_4", | |
| "seed": 42, | |
| "push_to_hub": true, | |
| "no_push_to_hub": false, | |
| "hub_model_id": "deqing/lstm-window-4-v5", | |
| "push_every_n_tokens": 200000000, | |
| "no_wandb": false, | |
| "wandb_run_suffix": null, | |
| "resume": false, | |
| "no_compile": false, | |
| "optimizer": "adamw" | |
| } |