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 folder using huggingface_hub
Browse files- README.md +45 -0
- model_infer.onnx +3 -0
- noesis.pt +3 -0
- requirements.txt +5 -0
README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Aletheia Noesis Decoder
|
| 2 |
+
|
| 3 |
+
Noesis é o decoder proprietário da AletheiaEngine. Ele traduz estados simbólicos \(\psi_s\) em linguagem natural garantindo a coerência epistemológica medida pela **Qualidade da Verdade (Q)**. Diferente de abordagens puramente estatísticas, o Noesis prioriza a fidelidade semântica entre a intenção simbólica e o texto gerado.
|
| 4 |
+
|
| 5 |
+
## Arquitetura
|
| 6 |
+
|
| 7 |
+
- **Transformer Decoder** com 8 camadas e atenção cruzada condicionada por \(\psi_s\) e estados contínuos.
|
| 8 |
+
- Entradas: vetor de intenção `psi_s`, memória lenta `state` opcional e sequência de tokens.
|
| 9 |
+
- Saídas: `logits`, embedding semântico `z_text` e métrica \(\hat{Q}\).
|
| 10 |
+
- Função de perda combina cross-entropy, coerência Q e penalizações de restrições.
|
| 11 |
+
|
| 12 |
+
## API FastAPI
|
| 13 |
+
|
| 14 |
+
O pacote inclui a aplicação `aletheia_decoder.api.app` com duas rotas:
|
| 15 |
+
|
| 16 |
+
- `POST /generate`: recebe `psi_s`, `state`, `constraints`, prompts opcionais e parâmetros de decodificação. Retorna texto gerado, tokens, \(\hat{Q}\) e metadados.
|
| 17 |
+
- `POST /train`: permite fine-tuning local a partir de um dataset JSONL.
|
| 18 |
+
|
| 19 |
+
### Execução local
|
| 20 |
+
|
| 21 |
+
```bash
|
| 22 |
+
pip install -r requirements.txt
|
| 23 |
+
uvicorn aletheia_decoder.api.app:app --host 0.0.0.0 --port 8000
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
## Treinamento
|
| 27 |
+
|
| 28 |
+
Use o script `aletheia_decoder/model/train.py` para treinar o modelo com dados anotados:
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
python -m aletheia_decoder.model.train data/dataset.jsonl --epochs 200 --batch-size 4 --lr 3e-5
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
Os checkpoints podem ser salvos com `torch.save(model.state_dict(), "noesis.pt")` e exportados para ONNX se necessário.
|
| 35 |
+
|
| 36 |
+
## Deploy no Hugging Face Spaces
|
| 37 |
+
|
| 38 |
+
1. Faça fork deste diretório para um repositório separado.
|
| 39 |
+
2. Configure o Space no modo **FastAPI** apontando para `app:app`.
|
| 40 |
+
3. Defina as variáveis de ambiente de acordo com sua infraestrutura (ex.: `DECODER_ENDPOINT`).
|
| 41 |
+
4. Opcionalmente publique checkpoints `.pt` e `.onnx` nos assets do Space.
|
| 42 |
+
|
| 43 |
+
## Slogan
|
| 44 |
+
|
| 45 |
+
> **Noesis — onde a intenção se torna linguagem.**
|
model_infer.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1154ef7aefd95931fcfb7c882cac57d258b340c4971eb62394e69a8e54570370
|
| 3 |
+
size 1605756
|
noesis.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a0819b6a076be07ffb89add5a3dbd8337c07e05ae7e08319e5f7dc0c4fd27a19
|
| 3 |
+
size 507122536
|
requirements.txt
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
fastapi>=0.110
|
| 2 |
+
uvicorn[standard]>=0.23
|
| 3 |
+
pydantic>=2.6
|
| 4 |
+
torch>=2.1
|
| 5 |
+
numpy>=1.24
|