Instructions to use cjvt/OPT_GaMS-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cjvt/OPT_GaMS-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cjvt/OPT_GaMS-1B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cjvt/OPT_GaMS-1B") model = AutoModelForCausalLM.from_pretrained("cjvt/OPT_GaMS-1B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use cjvt/OPT_GaMS-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cjvt/OPT_GaMS-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cjvt/OPT_GaMS-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cjvt/OPT_GaMS-1B
- SGLang
How to use cjvt/OPT_GaMS-1B 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 "cjvt/OPT_GaMS-1B" \ --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": "cjvt/OPT_GaMS-1B", "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 "cjvt/OPT_GaMS-1B" \ --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": "cjvt/OPT_GaMS-1B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cjvt/OPT_GaMS-1B with Docker Model Runner:
docker model run hf.co/cjvt/OPT_GaMS-1B
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,7 +9,7 @@ language:
|
|
| 9 |
library_name: transformers
|
| 10 |
---
|
| 11 |
|
| 12 |
-
#
|
| 13 |
|
| 14 |
This is the 1B OPT model additionally pretrained on Slovene data. The model was created as a part of project Povejmo: https://www.cjvt.si/povejmo/.
|
| 15 |
|
|
@@ -41,11 +41,12 @@ The inference can be done using the following snippet of code:
|
|
| 41 |
```python
|
| 42 |
from transformers import AutoTokenizer, pipeline
|
| 43 |
|
| 44 |
-
|
|
|
|
| 45 |
|
| 46 |
pline = pipeline(
|
| 47 |
"text-generation",
|
| 48 |
-
model=
|
| 49 |
tokenizer=tokenizer,
|
| 50 |
device_map="auto"
|
| 51 |
)
|
|
|
|
| 9 |
library_name: transformers
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# OPT_GaMS 1B
|
| 13 |
|
| 14 |
This is the 1B OPT model additionally pretrained on Slovene data. The model was created as a part of project Povejmo: https://www.cjvt.si/povejmo/.
|
| 15 |
|
|
|
|
| 41 |
```python
|
| 42 |
from transformers import AutoTokenizer, pipeline
|
| 43 |
|
| 44 |
+
model_id = "cjvt/OPT_GaMS-1B"
|
| 45 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 46 |
|
| 47 |
pline = pipeline(
|
| 48 |
"text-generation",
|
| 49 |
+
model=model_id,
|
| 50 |
tokenizer=tokenizer,
|
| 51 |
device_map="auto"
|
| 52 |
)
|