Text Generation
Transformers
Safetensors
GGUF
English
llama
supra
chimera
50m
small
open
open-source
cpu
tiny
slm
text-generation-inference
Instructions to use SupraLabs/Supra-50M-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SupraLabs/Supra-50M-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SupraLabs/Supra-50M-Instruct")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SupraLabs/Supra-50M-Instruct") model = AutoModelForCausalLM.from_pretrained("SupraLabs/Supra-50M-Instruct") - llama-cpp-python
How to use SupraLabs/Supra-50M-Instruct with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="SupraLabs/Supra-50M-Instruct", filename="Supra-50M-f16.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use SupraLabs/Supra-50M-Instruct with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf SupraLabs/Supra-50M-Instruct:F16 # Run inference directly in the terminal: llama cli -hf SupraLabs/Supra-50M-Instruct:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf SupraLabs/Supra-50M-Instruct:F16 # Run inference directly in the terminal: llama cli -hf SupraLabs/Supra-50M-Instruct:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf SupraLabs/Supra-50M-Instruct:F16 # Run inference directly in the terminal: ./llama-cli -hf SupraLabs/Supra-50M-Instruct:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf SupraLabs/Supra-50M-Instruct:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf SupraLabs/Supra-50M-Instruct:F16
Use Docker
docker model run hf.co/SupraLabs/Supra-50M-Instruct:F16
- LM Studio
- Jan
- vLLM
How to use SupraLabs/Supra-50M-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SupraLabs/Supra-50M-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SupraLabs/Supra-50M-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/SupraLabs/Supra-50M-Instruct:F16
- SGLang
How to use SupraLabs/Supra-50M-Instruct 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 "SupraLabs/Supra-50M-Instruct" \ --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": "SupraLabs/Supra-50M-Instruct", "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 "SupraLabs/Supra-50M-Instruct" \ --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": "SupraLabs/Supra-50M-Instruct", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Ollama
How to use SupraLabs/Supra-50M-Instruct with Ollama:
ollama run hf.co/SupraLabs/Supra-50M-Instruct:F16
- Unsloth Studio
How to use SupraLabs/Supra-50M-Instruct with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SupraLabs/Supra-50M-Instruct to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SupraLabs/Supra-50M-Instruct to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SupraLabs/Supra-50M-Instruct to start chatting
- Atomic Chat new
- Docker Model Runner
How to use SupraLabs/Supra-50M-Instruct with Docker Model Runner:
docker model run hf.co/SupraLabs/Supra-50M-Instruct:F16
- Lemonade
How to use SupraLabs/Supra-50M-Instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SupraLabs/Supra-50M-Instruct:F16
Run and chat with the model
lemonade run user.Supra-50M-Instruct-F16
List all available models
lemonade list
SupraLabs/Supra-50M-Instruct
#4
by aizexintong - opened
- .gitattributes +0 -1
- README.md +2 -23
- Supra-50M-f16.gguf β supra-50m-instruct-f16.gguf +2 -2
.gitattributes
CHANGED
|
@@ -34,4 +34,3 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
supra-50m-instruct-f16.gguf filter=lfs diff=lfs merge=lfs -text
|
| 37 |
-
Supra-50M-f16.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
supra-50m-instruct-f16.gguf filter=lfs diff=lfs merge=lfs -text
|
|
|
README.md
CHANGED
|
@@ -20,7 +20,6 @@ tags:
|
|
| 20 |
- slm
|
| 21 |
base_model:
|
| 22 |
- SupraLabs/Supra-50M-Base
|
| 23 |
-
new_version: SupraLabs/Supra-1.5-50M-Instruct-exp
|
| 24 |
---
|
| 25 |
|
| 26 |
# π¦
Supra-50M Instruct
|
|
@@ -78,10 +77,8 @@ For more details, the full code, configs and weights, please refer to [https://h
|
|
| 78 |
```python
|
| 79 |
import os
|
| 80 |
import warnings
|
| 81 |
-
import time
|
| 82 |
|
| 83 |
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
|
| 84 |
-
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
| 85 |
warnings.filterwarnings("ignore", category=UserWarning, module="transformers")
|
| 86 |
|
| 87 |
import torch
|
|
@@ -89,13 +86,6 @@ from transformers import pipeline, AutoTokenizer, logging
|
|
| 89 |
|
| 90 |
logging.set_verbosity_error()
|
| 91 |
|
| 92 |
-
# ββ Global variables ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 93 |
-
|
| 94 |
-
end = time.time()
|
| 95 |
-
start = time.time()
|
| 96 |
-
tokens = []
|
| 97 |
-
|
| 98 |
-
|
| 99 |
# ββ Config ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 100 |
|
| 101 |
MODEL_ID = "SupraLabs/Supra-50M-Instruct"
|
|
@@ -140,7 +130,7 @@ def build_prompt(instruction: str, input_text: str = "") -> str:
|
|
| 140 |
|
| 141 |
def generate(instruction: str, input_text: str = "", max_new_tokens: int = MAX_NEW_TOKENS) -> str:
|
| 142 |
prompt = build_prompt(instruction, input_text)
|
| 143 |
-
|
| 144 |
result = pipe(
|
| 145 |
prompt,
|
| 146 |
max_new_tokens=max_new_tokens,
|
|
@@ -154,13 +144,7 @@ def generate(instruction: str, input_text: str = "", max_new_tokens: int = MAX_N
|
|
| 154 |
return_full_text=False,
|
| 155 |
generation_config=None
|
| 156 |
)
|
| 157 |
-
end = time.time()
|
| 158 |
-
|
| 159 |
-
generated_text = result[0]["generated_text"]
|
| 160 |
-
tokens = pipe.tokenizer(generated_text)["input_ids"]
|
| 161 |
|
| 162 |
-
return generated_text, tokens, end, start
|
| 163 |
-
|
| 164 |
# ββ Interactive loop ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 165 |
|
| 166 |
if __name__ == "__main__":
|
|
@@ -174,13 +158,8 @@ if __name__ == "__main__":
|
|
| 174 |
inp = input("Input (optional, Enter to skip): ").strip()
|
| 175 |
|
| 176 |
print("-" * 50)
|
| 177 |
-
|
| 178 |
-
print(text)
|
| 179 |
print()
|
| 180 |
-
|
| 181 |
-
print(f"Generated tokens: {len(tokens)}")
|
| 182 |
-
print(f"Time: {end - start:.2f}s")
|
| 183 |
-
print(f"Speed: {len(tokens) / (end - start):.2f} tokens/sec")
|
| 184 |
```
|
| 185 |
|
| 186 |
---
|
|
|
|
| 20 |
- slm
|
| 21 |
base_model:
|
| 22 |
- SupraLabs/Supra-50M-Base
|
|
|
|
| 23 |
---
|
| 24 |
|
| 25 |
# π¦
Supra-50M Instruct
|
|
|
|
| 77 |
```python
|
| 78 |
import os
|
| 79 |
import warnings
|
|
|
|
| 80 |
|
| 81 |
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
|
|
|
|
| 82 |
warnings.filterwarnings("ignore", category=UserWarning, module="transformers")
|
| 83 |
|
| 84 |
import torch
|
|
|
|
| 86 |
|
| 87 |
logging.set_verbosity_error()
|
| 88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
# ββ Config ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 90 |
|
| 91 |
MODEL_ID = "SupraLabs/Supra-50M-Instruct"
|
|
|
|
| 130 |
|
| 131 |
def generate(instruction: str, input_text: str = "", max_new_tokens: int = MAX_NEW_TOKENS) -> str:
|
| 132 |
prompt = build_prompt(instruction, input_text)
|
| 133 |
+
|
| 134 |
result = pipe(
|
| 135 |
prompt,
|
| 136 |
max_new_tokens=max_new_tokens,
|
|
|
|
| 144 |
return_full_text=False,
|
| 145 |
generation_config=None
|
| 146 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
|
|
|
|
|
|
|
| 148 |
# ββ Interactive loop ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 149 |
|
| 150 |
if __name__ == "__main__":
|
|
|
|
| 158 |
inp = input("Input (optional, Enter to skip): ").strip()
|
| 159 |
|
| 160 |
print("-" * 50)
|
| 161 |
+
print(generate(instruction, inp))
|
|
|
|
| 162 |
print()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
```
|
| 164 |
|
| 165 |
---
|
Supra-50M-f16.gguf β supra-50m-instruct-f16.gguf
RENAMED
|
@@ -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:e104f91e7aeed5c11d1601461b93ddc6b71c8d607d064c3afd8d0bfe5590647f
|
| 3 |
+
size 104741056
|