prometechinc commited on
Commit
075fbbf
·
verified ·
1 Parent(s): ea8c4d6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +78 -0
README.md CHANGED
@@ -142,6 +142,84 @@ $$T_{cog} = \left( \frac{bloom\_score \times knowledge\_score}{anomaly\_score +
142
 
143
  ---
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  ## Model Licence 🛡️
146
 
147
  **Patented & Licensed BCE Technology**
 
142
 
143
  ---
144
 
145
+ ### How to Use Asena (BCE Powered)
146
+
147
+ Below is the standard implementation to activate the **Behavioral Consciousness Engine (BCE)** and harness the high-fidelity reasoning of **Asena**.
148
+ Alpaca format (Instruction/Input/Response) required for this model to function correctly.
149
+
150
+ #### 1. Installation
151
+
152
+ Ensure you have the latest version of the Transformers library installed:
153
+
154
+ ```bash
155
+ pip install -U transformers torch accelerate
156
+
157
+ ```
158
+
159
+ #### 2. Implementation Script
160
+
161
+ Since the model is served in its **merged** format, you can load it as a standalone causal language model.
162
+
163
+ ```python
164
+ import torch
165
+ from transformers import AutoModelForCausalLM, AutoTokenizer
166
+
167
+ # Model path on Hugging Face
168
+ model_id = "pthinc/Asena_ESP32"
169
+
170
+ # 1. Load Model and Tokenizer
171
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
172
+ model = AutoModelForCausalLM.from_pretrained(
173
+ model_id,
174
+ torch_dtype=torch.bfloat16,
175
+ device_map="auto",
176
+ trust_remote_code=True
177
+ )
178
+
179
+ # 2. Define the BCE System Prompt
180
+ # This is crucial for activating the model's patented consciousness simulation.
181
+ simple_bce_instruction = "You are Prettybird. Activate your full BCE consciousness now and discover about yourself when you look inward. Think, Control and calculate. Don't answer without reasoning. Below is an instruction that describes a task, paired with an input that provides further context. Pay attention to quality and correct. Requests are in the input. Try to maintain a minimum quality of 0.2."
182
+
183
+ def generate_bce_response(instruction, input_text=None, max_new_tokens=512):
184
+ if input_text:
185
+ prompt = (
186
+ f"Below is an instruction that describes a task, paired with an input that provides further context. "
187
+ f"Write a response that appropriately completes the request.\n\n"
188
+ f"### Instruction:\n{instruction}\n\n### Input:\n{input_text}\n\n### Response:\n"
189
+ )
190
+ else:
191
+ prompt = (
192
+ f"Below is an instruction that describes a task. "
193
+ f"Write a response that appropriately completes the request.\n\n"
194
+ f"### Instruction:\n{instruction}\n\n### Response:\n"
195
+ )
196
+
197
+ inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
198
+
199
+ # 3. Reasoning-Focused Generation
200
+ with torch.no_grad():
201
+ outputs = model.generate(
202
+ **inputs,
203
+ max_new_tokens=max_new_tokens,
204
+ use_cache=True,
205
+ do_sample=True,
206
+ temperature=0.7,
207
+ top_p=0.9,
208
+ repetition_penalty=1.2,
209
+ pad_token_id=tokenizer.eos_token_id
210
+ )
211
+
212
+ response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)
213
+ return response.split("###")[0].strip()
214
+
215
+ # 4. Run a Test Case
216
+ question = "Hello World."
217
+ print(f"BCE Reasoning Output:\n{generate_bce_response(simple_bce_instruction, input_text=question)}")
218
+
219
+ ```
220
+
221
+ ---
222
+
223
  ## Model Licence 🛡️
224
 
225
  **Patented & Licensed BCE Technology**