Text Generation
Transformers
Safetensors
granite_switch
granite
granite-switch
lora
adapters
mixture-of-adapters
conversational
Instructions to use barha/granite-switch-4.0-350m-demo with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use barha/granite-switch-4.0-350m-demo with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="barha/granite-switch-4.0-350m-demo") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("barha/granite-switch-4.0-350m-demo", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use barha/granite-switch-4.0-350m-demo with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "barha/granite-switch-4.0-350m-demo" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "barha/granite-switch-4.0-350m-demo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/barha/granite-switch-4.0-350m-demo
- SGLang
How to use barha/granite-switch-4.0-350m-demo 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 "barha/granite-switch-4.0-350m-demo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "barha/granite-switch-4.0-350m-demo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "barha/granite-switch-4.0-350m-demo" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "barha/granite-switch-4.0-350m-demo", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use barha/granite-switch-4.0-350m-demo with Docker Model Runner:
docker model run hf.co/barha/granite-switch-4.0-350m-demo
granite-switch-4.0-350m 3-adapter aLoRA demo: cti-technique-mapping + text-to-json + genai-attack-vector
Browse files- BUILD.md +2 -2
- compose_report.json +0 -0
- config.json +3 -1
- model.safetensors +2 -2
BUILD.md
CHANGED
|
@@ -23,8 +23,8 @@ Total adapters: **3**
|
|
| 23 |
## Composition Details
|
| 24 |
|
| 25 |
- base_param_count: 352,379,904
|
| 26 |
-
- composed_param_count:
|
| 27 |
-
- Param delta: +
|
| 28 |
- compose_settings:
|
| 29 |
- technology: "alora"
|
| 30 |
- adapter_substitute_token_ids:
|
|
|
|
| 23 |
## Composition Details
|
| 24 |
|
| 25 |
- base_param_count: 352,379,904
|
| 26 |
+
- composed_param_count: 395,046,912
|
| 27 |
+
- Param delta: +12.11%
|
| 28 |
- compose_settings:
|
| 29 |
- technology: "alora"
|
| 30 |
- adapter_substitute_token_ids:
|
compose_report.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
config.json
CHANGED
|
@@ -69,7 +69,9 @@
|
|
| 69 |
"logits_scaling": 4,
|
| 70 |
"lora_target_modules": [
|
| 71 |
"o_proj",
|
| 72 |
-
"qkv_proj"
|
|
|
|
|
|
|
| 73 |
],
|
| 74 |
"mamba_chunk_size": 256,
|
| 75 |
"mamba_conv_bias": true,
|
|
|
|
| 69 |
"logits_scaling": 4,
|
| 70 |
"lora_target_modules": [
|
| 71 |
"o_proj",
|
| 72 |
+
"qkv_proj",
|
| 73 |
+
"shared_input_linear",
|
| 74 |
+
"shared_output_linear"
|
| 75 |
],
|
| 76 |
"mamba_chunk_size": 256,
|
| 77 |
"mamba_conv_bias": true,
|
model.safetensors
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:2e65b435598d9113af42cb90144050d745a78f8c261f5e89f53738215e15508d
|
| 3 |
+
size 790968296
|