Instructions to use g-ronimo/phi-2_riddles-evolved with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use g-ronimo/phi-2_riddles-evolved with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="g-ronimo/phi-2_riddles-evolved", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("g-ronimo/phi-2_riddles-evolved", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use g-ronimo/phi-2_riddles-evolved with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "g-ronimo/phi-2_riddles-evolved" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "g-ronimo/phi-2_riddles-evolved", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/g-ronimo/phi-2_riddles-evolved
- SGLang
How to use g-ronimo/phi-2_riddles-evolved 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 "g-ronimo/phi-2_riddles-evolved" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "g-ronimo/phi-2_riddles-evolved", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "g-ronimo/phi-2_riddles-evolved" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "g-ronimo/phi-2_riddles-evolved", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use g-ronimo/phi-2_riddles-evolved with Docker Model Runner:
docker model run hf.co/g-ronimo/phi-2_riddles-evolved
| { | |
| "_name_or_path": "models/phi-2-RIDDLES-out-bfcb8c66-5417-42ba-821c-65a09528003d/checkpoint-460", | |
| "activation_function": "gelu_new", | |
| "architectures": [ | |
| "PhiForCausalLM" | |
| ], | |
| "attn_pdrop": 0.0, | |
| "auto_map": { | |
| "AutoConfig": "configuration_phi.PhiConfig", | |
| "AutoModelForCausalLM": "modeling_phi.PhiForCausalLM" | |
| }, | |
| "embd_pdrop": 0.0, | |
| "eos_token_id": 50297, | |
| "flash_attn": false, | |
| "flash_rotary": false, | |
| "fused_dense": false, | |
| "img_processor": null, | |
| "initializer_range": 0.02, | |
| "layer_norm_epsilon": 1e-05, | |
| "model_type": "phi-msft", | |
| "n_embd": 2560, | |
| "n_head": 32, | |
| "n_head_kv": null, | |
| "n_inner": null, | |
| "n_layer": 32, | |
| "n_positions": 2048, | |
| "resid_pdrop": 0.1, | |
| "rotary_dim": 32, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.36.2", | |
| "vocab_size": 50304 | |
| } | |