Instructions to use rwitz2/phi-500m-c2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rwitz2/phi-500m-c2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rwitz2/phi-500m-c2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rwitz2/phi-500m-c2") model = AutoModelForCausalLM.from_pretrained("rwitz2/phi-500m-c2") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use rwitz2/phi-500m-c2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rwitz2/phi-500m-c2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rwitz2/phi-500m-c2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/rwitz2/phi-500m-c2
- SGLang
How to use rwitz2/phi-500m-c2 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 "rwitz2/phi-500m-c2" \ --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": "rwitz2/phi-500m-c2", "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 "rwitz2/phi-500m-c2" \ --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": "rwitz2/phi-500m-c2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use rwitz2/phi-500m-c2 with Docker Model Runner:
docker model run hf.co/rwitz2/phi-500m-c2
Upload 6 files
Browse files- config (10).jsonZone.Identifier +4 -0
- config.json +28 -0
- model (5).safetensorsZone.Identifier +4 -0
- model.safetensors +3 -0
- tokenizer (6).modelZone.Identifier +4 -0
- tokenizer.model +3 -0
config (10).jsonZone.Identifier
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[ZoneTransfer]
|
| 2 |
+
ZoneId=3
|
| 3 |
+
ReferrerUrl=https://jupyter0-bn7dvnjr.brevlab.com/lab/tree/results5
|
| 4 |
+
HostUrl=https://jupyter0-bn7dvnjr.brevlab.com/files/results5/config.json?_xsrf=2%7C60c7d29b%7Caed6f3f126580e50acbe0ba8e9ec3026%7C1717619367
|
config.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "results4/checkpoint-5000",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"MistralForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"eos_token_id": 32000,
|
| 9 |
+
"hidden_act": "silu",
|
| 10 |
+
"hidden_size": 1024,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"intermediate_size": 2816,
|
| 13 |
+
"max_position_embeddings": 2048,
|
| 14 |
+
"model_type": "mistral",
|
| 15 |
+
"num_attention_heads": 16,
|
| 16 |
+
"num_hidden_layers": 24,
|
| 17 |
+
"num_key_value_heads": 16,
|
| 18 |
+
"pad_token_id": 0,
|
| 19 |
+
"rms_norm_eps": 1e-05,
|
| 20 |
+
"rope_theta": 10000.0,
|
| 21 |
+
"sliding_window": 2048,
|
| 22 |
+
"tie_word_embeddings": false,
|
| 23 |
+
"torch_dtype": "bfloat16",
|
| 24 |
+
"transformers_version": "4.41.2",
|
| 25 |
+
"unsloth_version": "2024.5",
|
| 26 |
+
"use_cache": true,
|
| 27 |
+
"vocab_size": 32064
|
| 28 |
+
}
|
model (5).safetensorsZone.Identifier
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[ZoneTransfer]
|
| 2 |
+
ZoneId=3
|
| 3 |
+
ReferrerUrl=https://jupyter0-bn7dvnjr.brevlab.com/lab/tree/results5
|
| 4 |
+
HostUrl=https://jupyter0-bn7dvnjr.brevlab.com/files/results5/model.safetensors?_xsrf=2%7C60c7d29b%7Caed6f3f126580e50acbe0ba8e9ec3026%7C1717619367
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:599eeb2a67585ff8f416ac796ed23e78996cf7785fbea838a84e72b44d594605
|
| 3 |
+
size 748022128
|
tokenizer (6).modelZone.Identifier
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[ZoneTransfer]
|
| 2 |
+
ZoneId=3
|
| 3 |
+
ReferrerUrl=https://jupyter0-bn7dvnjr.brevlab.com/lab/tree/results5
|
| 4 |
+
HostUrl=https://jupyter0-bn7dvnjr.brevlab.com/files/results5/tokenizer.model?_xsrf=2%7C60c7d29b%7Caed6f3f126580e50acbe0ba8e9ec3026%7C1717619367
|
tokenizer.model
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
|
| 3 |
+
size 499723
|