Skip to content

Commit 464c1b7

Browse files
committed
chore: rename range->slider, add larger ring
1 parent 455cc32 commit 464c1b7

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/app/_components/Range.tsx renamed to src/app/_components/Slider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// TODO: until this gets fixed the :focus does not really work for ranges in Safari (and macos webview)
22
// https://bugs.webkit.org/show_bug.cgi?id=234516
33

4-
export const Range = ({ label, onChange, ...props }) => {
4+
export const Slider = ({ label, onChange, ...props }) => {
55
return (
66
<div class="vstack gap-2 mb-2">
77
<label class="flex justify-between items-center">
@@ -10,7 +10,7 @@ export const Range = ({ label, onChange, ...props }) => {
1010
</label>
1111
<input
1212
type="range"
13-
class="w-full appearance-none h-1 rounded-full bg-neutral-4 focus:outline-none thumb:appearance-none thumb:size-2 thumb:-mt-0.75 thumb:bg-neutral-1 thumb:ring thumb:ring-neutral-10 thumb:rounded-full focus:thumb:ring-primary-9"
13+
class="w-full appearance-none h-1 rounded-full bg-neutral-4 focus:outline-none thumb:appearance-none thumb:size-2 thumb:-mt-0.75 thumb:bg-neutral-1 thumb:ring-2 thumb:ring-neutral-10 thumb:rounded-full focus:thumb:ring-2 focus:thumb:ring-primary-9"
1414
onChange={e => onChange(+e.target!.value)}
1515
{...props}
1616
/>

src/app/_components/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export { Markdown } from "./Markdown"
1313
export { Modal } from "./Modal"
1414
export { ModelSelect } from "./ModelSelect"
1515
export { Page } from "./Page"
16-
export { Range } from "./Range"
16+
export { Slider } from "./Slider"
1717
export { Resizable } from "./Resizable"
1818
export { SearchField } from "./SearchField"
1919
export { Select } from "./Select"

src/app/playground/SamplingOptions.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
import { FormGroup, Field, Range, Checkbox } from "../_components"
1+
import { FormGroup, Field, Slider, Checkbox } from "../_components"
22

33
export const SamplingOptions = ({ value, onChange }) => {
44
return (
55
<FormGroup class="p-3" value={value} onChange={onChange}>
66
<h3 class="mb-2 text-neutral-10 text-sm uppercase font-medium">Sampling options</h3>
77

88
<div class="vstack gap-3">
9-
<Field as={Range} name="temperature" label="Temperature" min={0} max={2} step={0.01} />
10-
<Field as={Range} name="top_k" label="Top K" min={1} max={100} />
11-
<Field as={Range} name="top_p" label="Top P" min={0} max={1} step={0.01} />
9+
<Field as={Slider} name="temperature" label="Temperature" min={0} max={2} step={0.01} />
10+
<Field as={Slider} name="top_k" label="Top K" min={1} max={100} />
11+
<Field as={Slider} name="top_p" label="Top P" min={0} max={1} step={0.01} />
1212

13-
<Field as={Range} name="repeat_n_last" label="Repeat N last" min={0} max={1024} />
14-
<Field as={Range} name="repeat_penalty" label="Repeat penalty" min={0} max={2} step={0.01} />
13+
<Field as={Slider} name="repeat_n_last" label="Repeat N last" min={0} max={1024} />
14+
<Field as={Slider} name="repeat_penalty" label="Repeat penalty" min={0} max={2} step={0.01} />
1515

16-
<Field as={Range} name="presence_penalty" label="Presence penalty" min={0} max={2} step={0.01} />
17-
<Field as={Range} name="frequency_penalty" label="Frequency penalty" min={0} max={2} step={0.01} />
16+
<Field as={Slider} name="presence_penalty" label="Presence penalty" min={0} max={2} step={0.01} />
17+
<Field as={Slider} name="frequency_penalty" label="Frequency penalty" min={0} max={2} step={0.01} />
1818

1919
<Field as={Checkbox} name="add_bos" label="Add BOS token" />
2020
<Field as={Checkbox} name="json" label="Sample JSON" />

0 commit comments

Comments
 (0)