Skip to content

Commit

Permalink
feat: added xtc sampling to local
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Aug 21, 2024
1 parent 52cf9c9 commit 746f401
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/constants/APIState/LocalAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class LocalAPI extends APIBase {
{ externalName: 'penalty_repeat', samplerID: SamplerID.REPETITION_PENALTY },
{ externalName: 'penalty_present', samplerID: SamplerID.PRESENCE_PENALTY },
{ externalName: 'penalty_freq', samplerID: SamplerID.FREQUENCY_PENALTY },
{ externalName: 'xtc_t', samplerID: SamplerID.XTC_THRESHOLD },
{ externalName: 'xtc_p', samplerID: SamplerID.XTC_PROBABILITY },
{ externalName: 'seed', samplerID: SamplerID.SEED },
]
buildPayload = () => {
Expand Down
29 changes: 29 additions & 0 deletions app/constants/SamplerData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ export enum SamplerID {
DRY_BASE = 'dry_base',
DRY_ALLOWED_LENGTH = 'dry_allowed_length',
DRY_SEQUENCE_BREAK = 'dry_sequence_break',

XTC_THRESHOLD = 'xtc_threshold',
XTC_PROBABILITY = 'xtc_probability',
//...
}

Expand Down Expand Up @@ -160,6 +163,32 @@ export const Samplers = {
precision: 2,
},
},
[SamplerID.XTC_PROBABILITY]: {
internalID: SamplerID.XTC_PROBABILITY,
friendlyName: 'XTC Probability',
inputType: 'slider',
values: {
type: 'float',
min: 0,
max: 1,
default: 0,
step: 0.01,
precision: 2,
},
},
[SamplerID.XTC_THRESHOLD]: {
internalID: SamplerID.XTC_THRESHOLD,
friendlyName: 'XTC Threshold',
inputType: 'slider',
values: {
type: 'float',
min: 0,
max: 1,
default: 0,
step: 0.01,
precision: 2,
},
},
[SamplerID.TOP_P]: {
internalID: SamplerID.TOP_P,
friendlyName: 'Top P',
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"babel-plugin-inline-import": "^3.0.0",
"babel-plugin-react-compiler": "^0.0.0-experimental-696af53-20240625",
"bert-tokenizer": "^1.1.8",
"cui-llama.rn": "^1.0.11",
"cui-llama.rn": "^1.1.1",
"drizzle-orm": "^0.30.10",
"eas-cli": "^9.1.0",
"expo": "~51.0.28",
Expand Down

0 comments on commit 746f401

Please sign in to comment.