Text Generation
Transformers
ONNX
PyTorch
English
symbolic-decoder
aletheia
philosophical-agi
gnai-creator
Instructions to use gnai-creator/noesis-decoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gnai-creator/noesis-decoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gnai-creator/noesis-decoder")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("gnai-creator/noesis-decoder", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use gnai-creator/noesis-decoder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gnai-creator/noesis-decoder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gnai-creator/noesis-decoder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/gnai-creator/noesis-decoder
- SGLang
How to use gnai-creator/noesis-decoder 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 "gnai-creator/noesis-decoder" \ --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": "gnai-creator/noesis-decoder", "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 "gnai-creator/noesis-decoder" \ --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": "gnai-creator/noesis-decoder", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use gnai-creator/noesis-decoder with Docker Model Runner:
docker model run hf.co/gnai-creator/noesis-decoder
Upload handler.py
Browse files- handler.py +21 -0
handler.py
CHANGED
|
@@ -135,6 +135,27 @@ class _SimpleTokenizer:
|
|
| 135 |
tokens.append(self.eos_token_id)
|
| 136 |
return tokens
|
| 137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
def _summarise_intent(psi: Sequence[float], top_k: int = 4) -> list[str]:
|
| 140 |
"""Convert strongest symbolic dimensions into descriptors."""
|
|
|
|
| 135 |
tokens.append(self.eos_token_id)
|
| 136 |
return tokens
|
| 137 |
|
| 138 |
+
def decode(self, token_ids: Sequence[int]) -> str:
|
| 139 |
+
"""Convert token IDs back into a text string."""
|
| 140 |
+
|
| 141 |
+
characters: list[str] = []
|
| 142 |
+
for idx in token_ids:
|
| 143 |
+
if idx == self.eos_token_id:
|
| 144 |
+
break
|
| 145 |
+
if idx in {self.pad_token_id, self.bos_token_id}:
|
| 146 |
+
continue
|
| 147 |
+
|
| 148 |
+
if 0 <= idx < len(self._tokens):
|
| 149 |
+
token = self._tokens[idx]
|
| 150 |
+
if token not in {"<pad>", "<bos>", "<eos>", "<unk>"}:
|
| 151 |
+
characters.append(token)
|
| 152 |
+
else:
|
| 153 |
+
characters.append("?")
|
| 154 |
+
else:
|
| 155 |
+
characters.append("?")
|
| 156 |
+
|
| 157 |
+
return "".join(characters)
|
| 158 |
+
|
| 159 |
|
| 160 |
def _summarise_intent(psi: Sequence[float], top_k: int = 4) -> list[str]:
|
| 161 |
"""Convert strongest symbolic dimensions into descriptors."""
|