Instructions to use decula/sd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use decula/sd with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-9B") model = PeftModel.from_pretrained(base_model, "decula/sd") - Transformers
How to use decula/sd with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="decula/sd")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("decula/sd", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use decula/sd with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "decula/sd" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "decula/sd", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/decula/sd
- SGLang
How to use decula/sd 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 "decula/sd" \ --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": "decula/sd", "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 "decula/sd" \ --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": "decula/sd", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use decula/sd with Docker Model Runner:
docker model run hf.co/decula/sd
decula commited on
Commit ·
e4e31e4
1
Parent(s): 382a3b0
modify frpc stpes
Browse files
app.py
CHANGED
|
@@ -156,7 +156,7 @@ with gr.Blocks(title=title) as demo:
|
|
| 156 |
with gr.Row():
|
| 157 |
with gr.Column():
|
| 158 |
prompt = gr.Textbox(lines=2, label="Prompt", value="")
|
| 159 |
-
token_count = gr.Slider(10,
|
| 160 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
| 161 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.3)
|
| 162 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=1)
|
|
|
|
| 156 |
with gr.Row():
|
| 157 |
with gr.Column():
|
| 158 |
prompt = gr.Textbox(lines=2, label="Prompt", value="")
|
| 159 |
+
token_count = gr.Slider(10, 3000, label="Max Tokens", step=30, value=60)
|
| 160 |
temperature = gr.Slider(0.2, 2.0, label="Temperature", step=0.1, value=1.0)
|
| 161 |
top_p = gr.Slider(0.0, 1.0, label="Top P", step=0.05, value=0.3)
|
| 162 |
presence_penalty = gr.Slider(0.0, 1.0, label="Presence Penalty", step=0.1, value=1)
|