Text Generation
Transformers
Safetensors
English
philolm
philosophy
base-model
trained-from-scratch
small-language-model
n-gram-embedding
muon
webassembly
custom_code
Instructions to use gustavecortal/PhiloLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gustavecortal/PhiloLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gustavecortal/PhiloLM", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("gustavecortal/PhiloLM", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gustavecortal/PhiloLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gustavecortal/PhiloLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gustavecortal/PhiloLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gustavecortal/PhiloLM
- SGLang
How to use gustavecortal/PhiloLM 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 "gustavecortal/PhiloLM" \ --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": "gustavecortal/PhiloLM", "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 "gustavecortal/PhiloLM" \ --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": "gustavecortal/PhiloLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gustavecortal/PhiloLM with Docker Model Runner:
docker model run hf.co/gustavecortal/PhiloLM
Download config.json from gustavecortal/PhiloLM: direct link, hf CLI and curl.
- Browser
- Download file 984 Bytes
-
https://huggingface.co/gustavecortal/PhiloLM/resolve/main/config.json
- Command line
-
hf download hf://gustavecortal/PhiloLM/config.json
-
curl -L -o config.json https://huggingface.co/gustavecortal/PhiloLM/resolve/main/config.json
984 Bytes
| { | |
| "model": { | |
| "blocks": 16, | |
| "width": 576, | |
| "query_heads": 9, | |
| "kv_heads": 9, | |
| "global_kv_heads": 3, | |
| "head_dim": 64, | |
| "ffn_intermediate": 1512, | |
| "rmsnorm_epsilon": 1e-06, | |
| "rope_base": 10000, | |
| "rope_dimensions": 32, | |
| "context_tokens": 4096, | |
| "tie_embeddings": true, | |
| "linear_bias": false, | |
| "initialization_std": 0.02, | |
| "residual_projection_initialization_scale": "1/sqrt(2*blocks)", | |
| "qk_norm": true, | |
| "attention_gate": true, | |
| "local_window": 256, | |
| "global_every": 4, | |
| "ngram": true, | |
| "ngram_orders": [ | |
| 2 | |
| ], | |
| "ngram_rows": 245760, | |
| "ngram_dim": 128, | |
| "ngram_heads": null, | |
| "ngram_layers": null, | |
| "key_offset": true, | |
| "document_mask": true | |
| }, | |
| "vocab_size": 32768, | |
| "eos_id": 0, | |
| "architectures": [ | |
| "PhiloLMForCausalLM" | |
| ], | |
| "model_type": "philolm", | |
| "auto_map": { | |
| "AutoConfig": "configuration_philolm.PhiloLMConfig", | |
| "AutoModelForCausalLM": "modeling_philolm.PhiloLMForCausalLM" | |
| }, | |
| "bos_token_id": 0, | |
| "eos_token_id": 0, | |
| "pad_token_id": 0 | |
| } |