Instructions to use HexawareTech/phi-base-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HexawareTech/phi-base-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HexawareTech/phi-base-model", trust_remote_code=True)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HexawareTech/phi-base-model", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("HexawareTech/phi-base-model", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HexawareTech/phi-base-model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HexawareTech/phi-base-model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HexawareTech/phi-base-model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HexawareTech/phi-base-model
- SGLang
How to use HexawareTech/phi-base-model 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 "HexawareTech/phi-base-model" \ --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": "HexawareTech/phi-base-model", "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 "HexawareTech/phi-base-model" \ --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": "HexawareTech/phi-base-model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HexawareTech/phi-base-model with Docker Model Runner:
docker model run hf.co/HexawareTech/phi-base-model
Delete config.json
Browse files- config.json +0 -34
config.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
| 1 |
-
{
|
| 2 |
-
"_name_or_path": "microsoft/phi-2",
|
| 3 |
-
"architectures": [
|
| 4 |
-
"PhiForCausalLM"
|
| 5 |
-
],
|
| 6 |
-
"attention_dropout": 0.0,
|
| 7 |
-
"auto_map": {
|
| 8 |
-
"AutoConfig": "microsoft/phi-2--configuration_phi.PhiConfig",
|
| 9 |
-
"AutoModelForCausalLM": "microsoft/phi-2--modeling_phi.PhiForCausalLM"
|
| 10 |
-
},
|
| 11 |
-
"bos_token_id": null,
|
| 12 |
-
"embd_pdrop": 0.0,
|
| 13 |
-
"eos_token_id": null,
|
| 14 |
-
"hidden_act": "gelu_new",
|
| 15 |
-
"hidden_size": 2560,
|
| 16 |
-
"initializer_range": 0.02,
|
| 17 |
-
"intermediate_size": 10240,
|
| 18 |
-
"layer_norm_eps": 1e-05,
|
| 19 |
-
"max_position_embeddings": 2048,
|
| 20 |
-
"model_type": "phi",
|
| 21 |
-
"num_attention_heads": 32,
|
| 22 |
-
"num_hidden_layers": 32,
|
| 23 |
-
"num_key_value_heads": 32,
|
| 24 |
-
"partial_rotary_factor": 0.4,
|
| 25 |
-
"qk_layernorm": false,
|
| 26 |
-
"resid_pdrop": 0.1,
|
| 27 |
-
"rope_scaling": null,
|
| 28 |
-
"rope_theta": 10000.0,
|
| 29 |
-
"tie_word_embeddings": false,
|
| 30 |
-
"torch_dtype": "float16",
|
| 31 |
-
"transformers_version": "4.37.0.dev0",
|
| 32 |
-
"use_cache": true,
|
| 33 |
-
"vocab_size": 51200
|
| 34 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|