@@ -28,6 +28,7 @@ export type MancerModel = {
28
28
const modelOptions = Object . entries ( mancerOptions ) . map ( ( [ label , value ] ) => ( { label, value } ) )
29
29
30
30
export const handleMancer : ModelAdapter = async function * ( opts ) {
31
+ const { gen } = opts
31
32
const url = 'https://neuro.mancer.tech/oai/v1/completions'
32
33
33
34
const userModel : string = opts . gen . registered ?. mancer ?. url || opts . user . adapterConfig ?. mancer ?. url
@@ -36,28 +37,36 @@ export const handleMancer: ModelAdapter = async function* (opts) {
36
37
const body : any = {
37
38
prompt : opts . prompt ,
38
39
model,
39
- add_bos_token : opts . gen . addBosToken ?? false ,
40
- ban_eos_token : opts . gen . banEosToken ?? false ,
41
- do_sample : true ,
40
+ ignore_eos : ! opts . gen . banEosToken ,
42
41
max_new_tokens : opts . gen . maxTokens ,
43
42
temperature : opts . gen . temp ! ,
44
43
top_a : opts . gen . topA ,
45
44
top_k : opts . gen . topK ,
46
45
top_p : opts . gen . topP ,
46
+ min_p : gen . minP ,
47
47
length_penalty : 1 ,
48
- truncation_length : opts . gen . maxContextLength ,
48
+ max_tokens : opts . gen . maxContextLength ,
49
49
typical_p : opts . gen . typicalP ,
50
- encoder_repetition_penalty : opts . gen . encoderRepitionPenalty ,
51
50
repetition_penalty : opts . gen . repetitionPenalty ,
52
- repetition_penalty_range : opts . gen . repetitionPenaltyRange ,
53
- skip_special_tokens : true ,
51
+ presence_penalty : opts . gen . presencePenalty ,
52
+ frequency_penalty : opts . gen . frequencyPenalty ,
54
53
tfs : opts . gen . tailFreeSampling ,
55
- penalty_alpha : opts . gen . penaltyAlpha ,
56
- num_beams : 1 ,
57
54
seed : - 1 ,
58
55
stop : getStoppingStrings ( opts ) ,
56
+ smoothing_factor : gen . smoothingFactor ,
57
+ smoothing_curve : gen . smoothingCurve ,
59
58
stream : opts . gen . streamResponse ,
60
59
}
60
+ if ( gen . dynatemp_range ) {
61
+ if ( gen . dynatemp_range >= gen . temp ! ) {
62
+ gen . dynatemp_range = gen . temp ! - 0.1
63
+ }
64
+
65
+ body . dynatemp_min = ( gen . temp ?? 1 ) - ( gen . dynatemp_range ?? 0 )
66
+ body . dynatemp_max = ( gen . temp ?? 1 ) + ( gen . dynatemp_range ?? 0 )
67
+ body . dynatemp_exponent = gen . dynatemp_exponent
68
+ body . dynatemp_mode = 1
69
+ }
61
70
62
71
if ( ! model ) {
63
72
yield { error : 'Mancer request failed: Select a model and try again' }
0 commit comments