Skip to content

Commit

Permalink
feat: add xct settings to the ui
Browse files Browse the repository at this point in the history
  • Loading branch information
a-ghorbani committed Nov 1, 2024
1 parent 2312d80 commit a5f2e3c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions jest/fixtures/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export const mockDefaultCompletionParams: CompletionParams = {
top_k: 40,
top_p: 0.95,
tfs_z: 1.0,
xtc_threshold: 0.1,
xtc_probability: 0.01,
typical_p: 1.0,
penalty_last_n: 64,
penalty_repeat: 1.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ export const CompletionSettings: React.FC<Props> = ({settings, onChange}) => {
{renderSlider('top_k', 1, 128, 1)}
{renderSlider('top_p', 0, 1)}
{renderSlider('tfs_z', 0, 2)}
{renderSlider('xtc_threshold', 0, 1)}
{renderSlider('xtc_probability', 0, 1)}
{renderSlider('typical_p', 0, 2)}
{renderSlider('penalty_last_n', 0, 256, 1)}
{renderSlider('penalty_repeat', 0, 2)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ describe('CompletionSettings', () => {
const tfsZSlider = getByTestId('tfs_z-slider');
expect(tfsZSlider.props.value).toBe(1);

expect(getByTestId('xtc_threshold-slider')).toBeTruthy();
const xtcThresholdSlider = getByTestId('xtc_threshold-slider');
expect(xtcThresholdSlider.props.value).toBe(0.1);

expect(getByTestId('xtc_probability-slider')).toBeTruthy();
const xtcProbabilitySlider = getByTestId('xtc_probability-slider');
expect(xtcProbabilitySlider.props.value).toBe(0.01);

expect(getByTestId('typical_p-slider')).toBeTruthy();
const typicalPSlider = getByTestId('typical_p-slider');
expect(typicalPSlider.props.value).toBe(1);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const defaultCompletionParams: CompletionParams = {
top_p: 0.95,
tfs_z: 1.0,
xtc_threshold: 0.1,
xtc_probability: 0.95,
xtc_probability: 0.0,
typical_p: 1.0,
penalty_last_n: 64,
penalty_repeat: 1.0,
Expand Down

0 comments on commit a5f2e3c

Please sign in to comment.