Instructions to use yujiepan/opt-tiny-2layers-random with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yujiepan/opt-tiny-2layers-random with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yujiepan/opt-tiny-2layers-random")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yujiepan/opt-tiny-2layers-random") model = AutoModelForCausalLM.from_pretrained("yujiepan/opt-tiny-2layers-random") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use yujiepan/opt-tiny-2layers-random with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yujiepan/opt-tiny-2layers-random" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yujiepan/opt-tiny-2layers-random", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/yujiepan/opt-tiny-2layers-random
- SGLang
How to use yujiepan/opt-tiny-2layers-random 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 "yujiepan/opt-tiny-2layers-random" \ --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": "yujiepan/opt-tiny-2layers-random", "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 "yujiepan/opt-tiny-2layers-random" \ --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": "yujiepan/opt-tiny-2layers-random", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use yujiepan/opt-tiny-2layers-random with Docker Model Runner:
docker model run hf.co/yujiepan/opt-tiny-2layers-random
Upload folder using huggingface_hub
Browse files- config.json +1 -1
- openvino_model.bin +2 -2
- openvino_model.xml +0 -0
- pytorch_model.bin +2 -2
config.json
CHANGED
|
@@ -24,7 +24,7 @@
|
|
| 24 |
"num_hidden_layers": 2,
|
| 25 |
"pad_token_id": 1,
|
| 26 |
"prefix": "</s>",
|
| 27 |
-
"torch_dtype": "
|
| 28 |
"transformers_version": "4.31.0",
|
| 29 |
"use_cache": true,
|
| 30 |
"vocab_size": 50272,
|
|
|
|
| 24 |
"num_hidden_layers": 2,
|
| 25 |
"pad_token_id": 1,
|
| 26 |
"prefix": "</s>",
|
| 27 |
+
"torch_dtype": "float32",
|
| 28 |
"transformers_version": "4.31.0",
|
| 29 |
"use_cache": true,
|
| 30 |
"vocab_size": 50272,
|
openvino_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61afdb708fc2d6e0afdabdd8243879b4f45d2a3eddf7e9ef9b0b3a27a8539daf
|
| 3 |
+
size 3289476
|
openvino_model.xml
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ed528002416ee5e22c5c532471570e240a39b2aa3d4b1ab33923718cafe0b0c3
|
| 3 |
+
size 1692061
|