File size: 742 Bytes
8749343
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28

from dataset import PasswordTesterDataset
import torch
import json

class DualityAI:
    def __init__(self, config_path):
        with open(config_path) as f:
            self.config = json.load(f)
        self.dataset = PasswordTesterDataset(
            self.config['safetensors_file'],
            self.config['tokenizer_file']
        )

    def interact(self, index=0):
        # BODY (raw tensor)
        body = self.dataset[index]
        # MIND (analytical view)
        mind = body.float() / 255.0
        return {'BODY': body, 'MIND': mind}

# Example usage
if __name__ == "__main__":
    ai = DualityAI("config.json")
    result = ai.interact(0)
    print("BODY tensor:", result['BODY'])
    print("MIND tensor:", result['MIND'])