gnai-creator commited on
Commit
3c5b2ff
·
verified ·
1 Parent(s): 56585b0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +88 -28
README.md CHANGED
@@ -15,48 +15,108 @@ language:
15
  pipeline_tag: text-generation
16
  ---
17
 
18
- # Aletheia Noesis Decoder
19
 
20
- 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.
 
 
21
 
22
- ## Arquitetura
 
 
23
 
24
- - **Transformer Decoder** com 8 camadas e atenção cruzada condicionada por \(\psi_s\) e estados contínuos.
25
- - Entradas: vetor de intenção `psi_s`, memória lenta `state` opcional e sequência de tokens.
26
- - Saídas: `logits`, embedding semântico `z_text` e métrica \(\hat{Q}\).
27
- - Função de perda combina cross-entropy, coerência Q e penalizações de restrições.
28
 
29
- ## API FastAPI
30
 
31
- O pacote inclui a aplicação `aletheia_decoder.api.app` com duas rotas:
32
 
33
- - `POST /generate`: recebe `psi_s`, `state`, `constraints`, prompts opcionais e parâmetros de decodificação. Retorna texto gerado, tokens, \(\hat{Q}\) e metadados.
34
- - `POST /train`: permite fine-tuning local a partir de um dataset JSONL.
35
 
36
- ### Execução local
 
37
 
38
- ```bash
39
- pip install -r requirements.txt
40
- uvicorn aletheia_decoder.api.app:app --host 0.0.0.0 --port 8000
41
- ```
 
 
 
 
 
 
 
42
 
43
- ## Treinamento
 
 
 
44
 
45
- Use o script `aletheia_decoder/model/train.py` para treinar o modelo com dados anotados:
 
 
 
 
 
46
 
47
- ```bash
48
- python -m aletheia_decoder.model.train data/dataset.jsonl --epochs 200 --batch-size 4 --lr 3e-5
 
 
 
 
 
 
 
 
 
49
  ```
50
 
51
- Os checkpoints podem ser salvos com `torch.save(model.state_dict(), "noesis.pt")` e exportados para ONNX se necessário.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
53
- ## Deploy no Hugging Face Spaces
54
 
55
- 1. Faça fork deste diretório para um repositório separado.
56
- 2. Configure o Space no modo **FastAPI** apontando para `app:app`.
57
- 3. Defina as variáveis de ambiente de acordo com sua infraestrutura (ex.: `DECODER_ENDPOINT`).
58
- 4. Opcionalmente publique checkpoints `.pt` e `.onnx` nos assets do Space.
59
 
60
- ## Slogan
 
 
 
 
 
 
 
 
 
 
 
 
 
61
 
62
- > **Noesis onde a intenção se torna linguagem.**
 
 
15
  pipeline_tag: text-generation
16
  ---
17
 
18
+ # 🧠 Noesis Decoder (AletheiaEngine)
19
 
20
+ **Repository:** [gnai-creator/noesis-decoder](https://huggingface.co/gnai-creator/noesis-decoder)
21
+ **Author:** Felipe M. Muniz (`gnai-creator`)
22
+ **License:** Apache-2.0
23
 
24
+ ---
25
+
26
+ ## 🔍 Overview
27
 
28
+ **Noesis Decoder** is the proprietary symbolic decoder of **AletheiaEngine** a hybrid symbolic–neural system designed for *philosophical artificial general intelligence*.
 
 
 
29
 
30
+ Unlike conventional text generators, Noesis translates **symbolic embeddings (ψₛ)** into meaningful language based on *epistemic coherence*, rather than statistical prediction.
31
 
32
+ ---
33
 
34
+ ## ⚙️ Model Architecture
 
35
 
36
+ * **Framework:** PyTorch → ONNX Runtime
37
+ * **Files:**
38
 
39
+ * `model_infer.onnx` – Inference model (optimized)
40
+ * `noesis.pt` PyTorch checkpoint (training artifact)
41
+ * `inference.py` Custom ONNX handler
42
+ * **Input:** float32 symbolic vector, shape `[1, D]`
43
+ * **Output:** decoded float or token embeddings (depending on context)
44
+
45
+ ---
46
+
47
+ ## 🧩 Example Usage
48
+
49
+ ### 🔹 Python + ONNX Runtime
50
 
51
+ ```python
52
+ from huggingface_hub import hf_hub_download
53
+ import onnxruntime as ort
54
+ import numpy as np
55
 
56
+ # Download ONNX model
57
+ onnx_path = hf_hub_download(
58
+ repo_id="gnai-creator/noesis-decoder",
59
+ filename="model_infer.onnx",
60
+ repo_type="model"
61
+ )
62
 
63
+ # Load runtime
64
+ sess = ort.InferenceSession(onnx_path, providers=["CPUExecutionProvider"])
65
+ input_name = sess.get_inputs()[0].name
66
+ output_name = sess.get_outputs()[0].name
67
+
68
+ # Example symbolic vector ψₛ
69
+ x = np.random.randn(1, 300).astype("float32")
70
+
71
+ # Run inference
72
+ y = sess.run([output_name], {input_name: x})[0]
73
+ print("Output shape:", y.shape)
74
  ```
75
 
76
+ ---
77
+
78
+ ## 💡 Training Data
79
+
80
+ Trained on **symbolic text pairs** generated from philosophical, logical, and reflective corpora within the AletheiaEngine ecosystem.
81
+ Goal: alignment between **symbolic intention (ψₛ)** and **natural language output**.
82
+
83
+ ---
84
+
85
+ ## 📊 Metrics (Indicative)
86
+
87
+ | Metric | Value | Description |
88
+ | ------------- | ------------ | ------------------------------------------ |
89
+ | Cosine(Q) | 0.83 | Symbolic alignment measure |
90
+ | Perplexity | 2.41 | Statistical readability proxy |
91
+ | Latency (CPU) | ~28 ms/token | Inference on Intel Sapphire Rapids (1vCPU) |
92
+
93
+ ---
94
+
95
+ ## 🚀 Deployment
96
+
97
+ This model is compatible with **Hugging Face Inference Endpoints** using the `Default` engine and the included `handler.py` handler.
98
 
99
+ Recommended hardware:
100
 
101
+ * **CPU:** Intel Sapphire Rapids (1vCPU / 2GB)
102
+ * **GPU:** NVIDIA T4 for larger batch inference
103
+
104
+ ---
105
 
106
+ ## ⚠️ Limitations
107
+
108
+ * Not a conventional LLM — requires symbolic vectors as input.
109
+ * Outputs are contextualized to Aletheia’s symbolic reasoning pipeline.
110
+ * Not suited for free-form text generation.
111
+
112
+ ---
113
+
114
+ ## 📜 License
115
+
116
+ This repository is distributed under the **Apache License 2.0**.
117
+ See [LICENSE](./LICENSE) for details.
118
+
119
+ ---
120
 
121
+ > *“Truth is not imposed; it emerges from alignment.”*
122
+ > — *Felipe M. Muniz (2025)*