File size: 1,315 Bytes
5fc8c9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# okto_version: "1.2"
PROJECT "BehaviorChatExample"
DESCRIPTION "Demonstrates BEHAVIOR block with mode and prompt_style"

ENV {

  accelerator: "gpu"

  min_memory: "8GB"

  precision: "fp16"
}

DATASET {

  train: "examples/datasets/demo_train.jsonl"

  format: "jsonl"

  type: "chat"

  language: "en"
}

MODEL {

  name: "behavior-chat-model"

  base: "oktoseek/base-mini"

  device: "cuda"
}

TRAIN {

  epochs: 5

  batch_size: 32

  learning_rate: 0.0001

  device: "cuda"
}

BEHAVIOR {

  mode: "chat"

  personality: "friendly"

  verbosity: "medium"

  language: "en"

  avoid: ["violence", "hate", "politics"]

  fallback: "I'm here to help! How can I assist you?"

  prompt_style: "User: {input}\nAssistant:"
}

INFERENCE {

  mode: "chat"

  format: "User: {input}\nAssistant:"

  exit_command: "/exit"
  
  params {

    max_length: 120

    temperature: 0.7

    top_p: 0.9

    do_sample: true
  }
  
  CONTROL {
    IF confidence < 0.3 { RETRY }
    IF repetition > 3 { REGENERATE }
  }
}

GUARD {
  prevent {
    toxicity
    bias
    hallucination
  }

  
  detect_using: ["classifier", "regex"]
  
  on_violation {
    REPLACE

    with_message: "Sorry, this request is not allowed."
  }
}

EXPORT {

  format: ["okm", "onnx"]

  path: "export/"
}