* Create dataset from request logs * Move drawer expansion logic out of app state * Add empty dataset page * Properly handle zero dataset state * Add DatasetEntriesTable * Open DatasetEntryEditorDrawer on row click * Add editable messages * Change Request Logs link to be a span * Add FunctionCallEditor * Change styling around * Stop logging variant stats after a while * Change FunctionCallEditor widths * Record input tokens even on errored calls * Allow user to add messages * Allow changing from empty text to function call * Fix some data layout issues * Default to empty output * Update arguments on blur * Add beta flag to datasets tab * Remove unused import * Save training and testing datasets on fine tune * Add DatasetEntryType * Condense migrations * Add index to datasetEntry * Add datasetEntry index * Fix types * Enable scrolling beyond last line in VariantEditor * Divide new dataset entries exactly along training/testing ratio
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
import { Button, HStack, Icon, Spinner, Text } from "@chakra-ui/react";
|
|
import { useOnForkButtonPressed } from "./useOnForkButtonPressed";
|
|
import { useExperiment } from "~/utils/hooks";
|
|
import { BsGearFill } from "react-icons/bs";
|
|
import { TbGitFork } from "react-icons/tb";
|
|
|
|
export const ExperimentHeaderButtons = ({ openDrawer }: { openDrawer: () => void }) => {
|
|
const experiment = useExperiment();
|
|
|
|
const canModify = experiment.data?.access.canModify ?? false;
|
|
|
|
const { onForkButtonPressed, isForking } = useOnForkButtonPressed();
|
|
|
|
if (experiment.isLoading) return null;
|
|
|
|
return (
|
|
<HStack spacing={0} mt={{ base: 2, md: 0 }}>
|
|
<Button
|
|
onClick={onForkButtonPressed}
|
|
mr={4}
|
|
colorScheme={canModify ? undefined : "orange"}
|
|
bgColor={canModify ? undefined : "orange.400"}
|
|
minW={0}
|
|
variant={{ base: "solid", md: canModify ? "ghost" : "solid" }}
|
|
>
|
|
{isForking ? <Spinner boxSize={5} /> : <Icon as={TbGitFork} boxSize={5} />}
|
|
<Text ml={2}>Fork</Text>
|
|
</Button>
|
|
{canModify && (
|
|
<Button variant={{ base: "solid", md: "ghost" }} onClick={openDrawer}>
|
|
<HStack>
|
|
<Icon as={BsGearFill} />
|
|
<Text>Settings</Text>
|
|
</HStack>
|
|
</Button>
|
|
)}
|
|
</HStack>
|
|
);
|
|
};
|