Skip to content

Commit

Permalink
unhide completion iterations (#3137)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlee64 authored Dec 11, 2024
1 parent 3e43f5f commit 1a9485f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ export const PlaygroundSettings: React.FC<PlaygroundSettingsProps> = ({
gap: '4px',
mt: 2,
}}>
<ResponseFormatEditor
responseFormat={playgroundState.responseFormat}
setResponseFormat={value =>
setPlaygroundStateField(idx, 'responseFormat', value)
}
/>
<FunctionEditor
playgroundState={playgroundState}
functions={playgroundState.functions}
Expand All @@ -71,22 +77,24 @@ export const PlaygroundSettings: React.FC<PlaygroundSettingsProps> = ({
}
/>

<ResponseFormatEditor
responseFormat={playgroundState.responseFormat}
setResponseFormat={value =>
setPlaygroundStateField(idx, 'responseFormat', value)
<StopSequenceEditor
stopSequences={playgroundState.stopSequences}
setStopSequences={value =>
setPlaygroundStateField(idx, 'stopSequences', value)
}
/>

{/* TODO: N times to run is not supported for all models */}
{/* TODO: rerun if this is not supported in the backend */}
<PlaygroundSlider
min={0}
max={2}
step={0.01}
min={1}
max={100}
step={1}
setValue={value =>
setPlaygroundStateField(idx, 'temperature', value)
setPlaygroundStateField(idx, 'nTimes', value)
}
label="Temperature"
value={playgroundState.temperature}
label="Completion iterations"
value={playgroundState.nTimes}
/>

<PlaygroundSlider
Expand All @@ -100,11 +108,15 @@ export const PlaygroundSettings: React.FC<PlaygroundSettingsProps> = ({
value={playgroundState.maxTokens}
/>

<StopSequenceEditor
stopSequences={playgroundState.stopSequences}
setStopSequences={value =>
setPlaygroundStateField(idx, 'stopSequences', value)
<PlaygroundSlider
min={0}
max={2}
step={0.01}
setValue={value =>
setPlaygroundStateField(idx, 'temperature', value)
}
label="Temperature"
value={playgroundState.temperature}
/>

<PlaygroundSlider
Expand Down Expand Up @@ -137,6 +149,7 @@ export const PlaygroundSettings: React.FC<PlaygroundSettingsProps> = ({
label="Presence penalty"
value={playgroundState.presencePenalty}
/>

<Box
sx={{
width: '100%',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type PlaygroundState = {
topP: number;
frequencyPenalty: number;
presencePenalty: number;
// nTimes: number;
nTimes: number;
maxTokensLimit: number;
model: LLMMaxTokensKey;
selectedChoiceIndex: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const DEFAULT_PLAYGROUND_STATE = {
topP: 1,
frequencyPenalty: 0,
presencePenalty: 0,
// nTimes: 1,
nTimes: 1,
maxTokensLimit: 16384,
model: DEFAULT_MODEL,
selectedChoiceIndex: 0,
Expand Down Expand Up @@ -91,9 +91,9 @@ export const usePlaygroundState = () => {
}
}
}
// if (inputs.n) {
// newState.nTimes = parseInt(inputs.n, 10);
// }
if (inputs.n) {
newState.nTimes = parseInt(inputs.n, 10);
}
if (inputs.temperature) {
newState.temperature = parseFloat(inputs.temperature);
}
Expand Down Expand Up @@ -148,7 +148,7 @@ export const getInputFromPlaygroundState = (state: PlaygroundState) => {
top_p: state.topP,
frequency_penalty: state.frequencyPenalty,
presence_penalty: state.presencePenalty,
// n: state.nTimes,
n: state.nTimes,
response_format: {
type: state.responseFormat,
},
Expand Down

0 comments on commit 1a9485f

Please sign in to comment.