Text Generation
Transformers
PyTorch
TensorFlow
JAX
Core ML
ONNX
Safetensors
Hebrew
gpt2
text-generation-inference
Instructions to use Norod78/distilgpt2-base-pretrained-he with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Norod78/distilgpt2-base-pretrained-he with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Norod78/distilgpt2-base-pretrained-he")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Norod78/distilgpt2-base-pretrained-he") model = AutoModelForCausalLM.from_pretrained("Norod78/distilgpt2-base-pretrained-he", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Norod78/distilgpt2-base-pretrained-he with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Norod78/distilgpt2-base-pretrained-he" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Norod78/distilgpt2-base-pretrained-he", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Norod78/distilgpt2-base-pretrained-he
- SGLang
How to use Norod78/distilgpt2-base-pretrained-he 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 "Norod78/distilgpt2-base-pretrained-he" \ --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": "Norod78/distilgpt2-base-pretrained-he", "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 "Norod78/distilgpt2-base-pretrained-he" \ --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": "Norod78/distilgpt2-base-pretrained-he", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Norod78/distilgpt2-base-pretrained-he with Docker Model Runner:
docker model run hf.co/Norod78/distilgpt2-base-pretrained-he
Doron Adler commited on
Commit ·
68eb283
1
Parent(s): f59d548
Added onnx, coreml support
Browse files- .gitattributes +1 -0
- distilgpt2-base-pretrained-he.mlpackage/Data/com.apple.CoreML/.gitattributes +1 -0
- distilgpt2-base-pretrained-he.mlpackage/Data/com.apple.CoreML/FeatureDescriptions.json +18 -0
- distilgpt2-base-pretrained-he.mlpackage/Data/com.apple.CoreML/Metadata.json +9 -0
- distilgpt2-base-pretrained-he.mlpackage/Data/com.apple.CoreML/model.mlmodel +3 -0
- distilgpt2-base-pretrained-he.mlpackage/Manifest.json +24 -0
- merges.txt +0 -0
- model.onnx +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +9 -0
- vocab.json +0 -0
.gitattributes
CHANGED
|
@@ -15,3 +15,4 @@
|
|
| 15 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 16 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 17 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 15 |
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 16 |
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 17 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
model.onnx filter=lfs diff=lfs merge=lfs -text
|
distilgpt2-base-pretrained-he.mlpackage/Data/com.apple.CoreML/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
model.mlmodel filter=lfs diff=lfs merge=lfs -text
|
distilgpt2-base-pretrained-he.mlpackage/Data/com.apple.CoreML/FeatureDescriptions.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"Outputs" : {
|
| 3 |
+
"output_logits" : {
|
| 4 |
+
"MLFeatureShortDescription" : ""
|
| 5 |
+
}
|
| 6 |
+
},
|
| 7 |
+
"Inputs" : {
|
| 8 |
+
"position_ids" : {
|
| 9 |
+
"MLFeatureShortDescription" : ""
|
| 10 |
+
},
|
| 11 |
+
"input_ids" : {
|
| 12 |
+
"MLFeatureShortDescription" : ""
|
| 13 |
+
}
|
| 14 |
+
},
|
| 15 |
+
"TrainingInputs" : {
|
| 16 |
+
|
| 17 |
+
}
|
| 18 |
+
}
|
distilgpt2-base-pretrained-he.mlpackage/Data/com.apple.CoreML/Metadata.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"MLModelVersionStringKey" : "1.0",
|
| 3 |
+
"MLModelDescriptionKey" : "hebrew-distilgpt2\n\nA tiny GPT2 based Hebrew text generation model trained on a TPUv3-8 via the TPU Research Cloud Program.",
|
| 4 |
+
"MLModelCreatorDefinedKey" : {
|
| 5 |
+
"model_card_url" : "https:\/\/huggingface.co\/Norod78\/distilgpt2-base-pretrained-he"
|
| 6 |
+
},
|
| 7 |
+
"MLModelAuthorKey" : "Doron Adler",
|
| 8 |
+
"MLModelLicenseKey" : "mit"
|
| 9 |
+
}
|
distilgpt2-base-pretrained-he.mlpackage/Data/com.apple.CoreML/model.mlmodel
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dacb6071938fc719d81c51db527ae9a756d4292c183cf05b8d3e646340a1544e
|
| 3 |
+
size 482254328
|
distilgpt2-base-pretrained-he.mlpackage/Manifest.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"fileFormatVersion": "1.0.0",
|
| 3 |
+
"itemInfoEntries": {
|
| 4 |
+
"06B636B9-5BE3-49A2-A06B-C09242D53296": {
|
| 5 |
+
"author": "com.apple.CoreML",
|
| 6 |
+
"description": "External FeatureDescription Overlay",
|
| 7 |
+
"name": "FeatureDescriptions.json",
|
| 8 |
+
"path": "com.apple.CoreML/FeatureDescriptions.json"
|
| 9 |
+
},
|
| 10 |
+
"A8586C2A-1DD7-4EEC-BB42-6B6242D7B530": {
|
| 11 |
+
"author": "com.apple.CoreML",
|
| 12 |
+
"description": "External Metadata Overlay",
|
| 13 |
+
"name": "Metadata.json",
|
| 14 |
+
"path": "com.apple.CoreML/Metadata.json"
|
| 15 |
+
},
|
| 16 |
+
"FD401BB0-2CA8-4DB7-BAD6-23B171A68404": {
|
| 17 |
+
"author": "com.apple.CoreML",
|
| 18 |
+
"description": "CoreML Model Specification",
|
| 19 |
+
"name": "distilgpt2-base-pretrained-he-64-6.mlmodel",
|
| 20 |
+
"path": "com.apple.CoreML/model.mlmodel"
|
| 21 |
+
}
|
| 22 |
+
},
|
| 23 |
+
"rootModelIdentifier": "FD401BB0-2CA8-4DB7-BAD6-23B171A68404"
|
| 24 |
+
}
|
merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
model.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b9459cc41adc2c406570135eb583a5d351b2f6ea636875d831cd2c36cfcc674
|
| 3 |
+
size 488438673
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token": "<s>",
|
| 3 |
+
"eos_token": "</s>",
|
| 4 |
+
"mask_token": "<mask>",
|
| 5 |
+
"pad_token": "<pad>",
|
| 6 |
+
"unk_token": "<unk>"
|
| 7 |
+
}
|
tokenizer.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"bos_token": "<|endoftext|>",
|
| 4 |
+
"eos_token": "<|endoftext|>",
|
| 5 |
+
"name_or_path": "./distilgpt2-base-pretrained-he",
|
| 6 |
+
"special_tokens_map_file": "./distilgpt2-base-pretrained-he/special_tokens_map.json",
|
| 7 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 8 |
+
"unk_token": "<|endoftext|>"
|
| 9 |
+
}
|
vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|