assemsabry commited on
Commit
56f12b9
ยท
verified ยท
1 Parent(s): 2cae889

Upload neuralnode_example.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. neuralnode_example.py +40 -0
neuralnode_example.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Horus Hiero โ€” NeuralNode Example Script"""
2
+ import neuralnode as nn
3
+
4
+ # --- Configuration ---
5
+ MODEL_ID = "tokenaii/Horus-Hiero-9B-GGUF/Horus-Hiero-9B-Q6_K.gguf"
6
+ # For Mini version: "tokenaii/Horus-Hiero-Mini-4B-GGUF/Horus-Hiero-Mini-4B-Q6_K.gguf"
7
+ DEVICE = "cpu" # Change to "cuda" for GPU acceleration
8
+
9
+ # --- Load model ---
10
+ model = nn.HorusModel(MODEL_ID, device=DEVICE).load()
11
+
12
+ # --- Basic Chat ---
13
+ response = model.chat([
14
+ {"role": "user", "content": "What is Horus Hiero?"}
15
+ ])
16
+ print("Basic Chat:", response.content)
17
+
18
+ # --- Streaming ---
19
+ print("\n--- Streaming ---")
20
+ chunks = model.chat([
21
+ {"role": "user", "content": "Write a short introduction about ancient Egyptian writing."}
22
+ ], stream=True)
23
+ for chunk in chunks:
24
+ if chunk.content:
25
+ print(chunk.content, end="", flush=True)
26
+ print()
27
+
28
+ # --- Thinking Mode ---
29
+ print("\n--- Thinking Mode ---")
30
+ response = model.chat([
31
+ {"role": "user", "content": "What is 7 plus 5? Reply in one sentence."}
32
+ ], thinking=True, show_thinking=False)
33
+ print("Answer:", response.content)
34
+
35
+ # --- Hieroglyphic Translation ---
36
+ print("\n--- Hieroglyphic Translation ---")
37
+ response = model.chat([
38
+ {"role": "user", "content": 'Translate this hieroglyph to English: ๐“‚‹๐“๐“ˆ–๐“€€'}
39
+ ])
40
+ print("Translation:", response.content)