Instructions to use dkalpakchi/SweCTRL-Mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dkalpakchi/SweCTRL-Mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dkalpakchi/SweCTRL-Mini")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dkalpakchi/SweCTRL-Mini") model = AutoModelForCausalLM.from_pretrained("dkalpakchi/SweCTRL-Mini") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use dkalpakchi/SweCTRL-Mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dkalpakchi/SweCTRL-Mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dkalpakchi/SweCTRL-Mini", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dkalpakchi/SweCTRL-Mini
- SGLang
How to use dkalpakchi/SweCTRL-Mini 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 "dkalpakchi/SweCTRL-Mini" \ --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": "dkalpakchi/SweCTRL-Mini", "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 "dkalpakchi/SweCTRL-Mini" \ --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": "dkalpakchi/SweCTRL-Mini", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dkalpakchi/SweCTRL-Mini with Docker Model Runner:
docker model run hf.co/dkalpakchi/SweCTRL-Mini
Commit ·
03d3c70
1
Parent(s): 9b53c2b
Update README.md
Browse files
README.md
CHANGED
|
@@ -97,9 +97,13 @@ For further recommendations on the use of the model, please see the associated p
|
|
| 97 |
|
| 98 |
## How to Get Started with the Model
|
| 99 |
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
|
| 104 |
## Training Details
|
| 105 |
|
|
|
|
| 97 |
|
| 98 |
## How to Get Started with the Model
|
| 99 |
|
| 100 |
+
The fastest way to start with the model is using the code below:
|
| 101 |
+
```py
|
| 102 |
+
from transformers import pipeline
|
| 103 |
+
pipe = pipeline(model="dkalpakchi/SweCTRL-Mini")
|
| 104 |
+
print(pipe(":nyheter:", max_length=256, repetition_penalty=1.1, top_p=0.9))
|
| 105 |
+
```
|
| 106 |
+
For more advanced uses and other code examples, please see the associated GitHub repository (https://github.com/dkalpakchi/SweCTRL-Mini).
|
| 107 |
|
| 108 |
## Training Details
|
| 109 |
|