Instructions to use 0ppxnhximxr/CodeAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 0ppxnhximxr/CodeAI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="0ppxnhximxr/CodeAI")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("0ppxnhximxr/CodeAI") model = AutoModelForCausalLM.from_pretrained("0ppxnhximxr/CodeAI") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use 0ppxnhximxr/CodeAI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "0ppxnhximxr/CodeAI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "0ppxnhximxr/CodeAI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/0ppxnhximxr/CodeAI
- SGLang
How to use 0ppxnhximxr/CodeAI 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 "0ppxnhximxr/CodeAI" \ --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": "0ppxnhximxr/CodeAI", "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 "0ppxnhximxr/CodeAI" \ --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": "0ppxnhximxr/CodeAI", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use 0ppxnhximxr/CodeAI with Docker Model Runner:
docker model run hf.co/0ppxnhximxr/CodeAI
Commit ·
73b73b9
1
Parent(s): 3ad77ee
Upload model
Browse files- config.json +5 -4
- model-00001-of-00002.safetensors +1 -1
- model-00002-of-00002.safetensors +1 -1
config.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
{
|
| 2 |
-
"_name_or_path": "gpt2",
|
| 3 |
"activation_function": "gelu_new",
|
| 4 |
"architectures": [
|
| 5 |
"GPT2LMHeadModel"
|
|
@@ -12,11 +12,12 @@
|
|
| 12 |
"layer_norm_epsilon": 1e-05,
|
| 13 |
"model_type": "gpt2",
|
| 14 |
"n_ctx": 1024,
|
| 15 |
-
"n_embd":
|
| 16 |
-
"n_head":
|
| 17 |
"n_inner": null,
|
| 18 |
-
"n_layer":
|
| 19 |
"n_positions": 1024,
|
|
|
|
| 20 |
"reorder_and_upcast_attn": false,
|
| 21 |
"resid_pdrop": 0.1,
|
| 22 |
"scale_attn_by_inverse_layer_idx": false,
|
|
|
|
| 1 |
{
|
| 2 |
+
"_name_or_path": "gpt2-xl",
|
| 3 |
"activation_function": "gelu_new",
|
| 4 |
"architectures": [
|
| 5 |
"GPT2LMHeadModel"
|
|
|
|
| 12 |
"layer_norm_epsilon": 1e-05,
|
| 13 |
"model_type": "gpt2",
|
| 14 |
"n_ctx": 1024,
|
| 15 |
+
"n_embd": 1600,
|
| 16 |
+
"n_head": 25,
|
| 17 |
"n_inner": null,
|
| 18 |
+
"n_layer": 48,
|
| 19 |
"n_positions": 1024,
|
| 20 |
+
"output_past": true,
|
| 21 |
"reorder_and_upcast_attn": false,
|
| 22 |
"resid_pdrop": 0.1,
|
| 23 |
"scale_attn_by_inverse_layer_idx": false,
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4970916328
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e2fcf93c2e2cd96af4e4c52ded3b669196ebad0320a9dbadfc527cd3a7f10fe0
|
| 3 |
size 4970916328
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1147659632
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e29e2b5941fec51089d251ac890ec9461c61a1b017e2e7b49539bd714addbad9
|
| 3 |
size 1147659632
|