Instructions to use appledora/recastSDP2-G16W32H16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use appledora/recastSDP2-G16W32H16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="appledora/recastSDP2-G16W32H16", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("appledora/recastSDP2-G16W32H16", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use appledora/recastSDP2-G16W32H16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "appledora/recastSDP2-G16W32H16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "appledora/recastSDP2-G16W32H16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/appledora/recastSDP2-G16W32H16
- SGLang
How to use appledora/recastSDP2-G16W32H16 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 "appledora/recastSDP2-G16W32H16" \ --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": "appledora/recastSDP2-G16W32H16", "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 "appledora/recastSDP2-G16W32H16" \ --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": "appledora/recastSDP2-G16W32H16", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use appledora/recastSDP2-G16W32H16 with Docker Model Runner:
docker model run hf.co/appledora/recastSDP2-G16W32H16
Upload __init__.py with huggingface_hub
Browse files- __init__.py +32 -0
__init__.py
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# filename: __init__.py
|
| 2 |
+
from transformers.utils import (
|
| 3 |
+
OptionalDependencyNotAvailable,
|
| 4 |
+
_LazyModule,
|
| 5 |
+
is_torch_available,
|
| 6 |
+
)
|
| 7 |
+
|
| 8 |
+
try:
|
| 9 |
+
if not is_torch_available():
|
| 10 |
+
raise OptionalDependencyNotAvailable()
|
| 11 |
+
except OptionalDependencyNotAvailable:
|
| 12 |
+
pass
|
| 13 |
+
else:
|
| 14 |
+
from .modeling_recast_llama import (
|
| 15 |
+
RECAST7b_llamaModel,
|
| 16 |
+
RECAST7b_LlamaForCausalLM,
|
| 17 |
+
)
|
| 18 |
+
from .configuration_recast_llama import RECAST7b_llama
|
| 19 |
+
|
| 20 |
+
from transformers import AutoConfig, AutoModel, AutoModelForCausalLM
|
| 21 |
+
|
| 22 |
+
# Register your models with Auto classes
|
| 23 |
+
AutoConfig.register("recast7b_llama", RECAST7b_llama)
|
| 24 |
+
AutoModel.register(RECAST7b_llama, RECAST7b_llamaModel)
|
| 25 |
+
AutoModelForCausalLM.register(RECAST7b_llama, RECAST7b_LlamaForCausalLM)
|
| 26 |
+
|
| 27 |
+
_import_structure = {
|
| 28 |
+
"configuration_recast_llama": ["RECAST7b_llama"],
|
| 29 |
+
"modeling_recast_llama": ["RECAST7b_llamaModel", "RECAST7b_LlamaForCausalLM"],
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
__all__ = ["RECAST7b_llamaModel", "RECAST7b_LlamaForCausalLM", "RECAST7b_llama"]
|