diff --git a/website/src/components/SideMenuLayout.tsx b/website/src/components/SideMenuLayout.tsx
index a768bc85..1e92a0c7 100644
--- a/website/src/components/SideMenuLayout.tsx
+++ b/website/src/components/SideMenuLayout.tsx
@@ -12,11 +12,11 @@ export const SideMenuLayout = (props: SideMenuLayoutProps) => {
return (
-
-
+
+
- {props.children}
+ {props.children}
);
diff --git a/website/src/components/Survey/LabelRadioGroup.tsx b/website/src/components/Survey/LabelRadioGroup.tsx
index 617b05b9..bf2521f6 100644
--- a/website/src/components/Survey/LabelRadioGroup.tsx
+++ b/website/src/components/Survey/LabelRadioGroup.tsx
@@ -1,4 +1,18 @@
-import { Box, Button, Flex, useColorMode } from "@chakra-ui/react";
+import {
+ Box,
+ Button,
+ Flex,
+ IconButton,
+ Popover,
+ PopoverArrow,
+ PopoverBody,
+ PopoverCloseButton,
+ PopoverContent,
+ PopoverTrigger,
+ Text,
+ useColorMode,
+} from "@chakra-ui/react";
+import { InformationCircleIcon } from "@heroicons/react/20/solid";
import { useId, useState } from "react";
import { colors } from "src/styles/Theme/colors";
@@ -8,6 +22,17 @@ interface LabelRadioGroupProps {
isEditable?: boolean;
}
+const label_messages: { [label: string]: { description: string; explanation: string[] } } = {
+ spam: {
+ description: "The message is spam?",
+ explanation: [
+ 'We consider the following unwanted content as spam: trolling, intentional undermining of our purpose, illegal material, material that violates our code of conduct, and other things that are inappropriate for our dataset. We collect these under the common heading of "spam".',
+ "This is not an assessment of whether this message is the best possible answer. Especially for prompts or user-replies, we very much want to retain all kinds of responses in the dataset, so that the assistant can learn to reply appropriately.",
+ "Please mark this text as spam only if it is clearly unsuited to be part of our dataset, as outlined above, and try not to make any subjective value-judgments beyond that.",
+ ],
+ },
+};
+
export const LabelRadioGroup = (props: LabelRadioGroupProps) => {
const [labelValues, setLabelValues] = useState(Array.from({ length: props.labelIDs.length }).map(() => 0));
const [interactionFlag, setInteractionFlag] = useState(false);
@@ -17,7 +42,7 @@ export const LabelRadioGroup = (props: LabelRadioGroupProps) => {
{props.labelIDs.map((labelId, idx) => (
{
const newState = labelValues.slice();
@@ -45,7 +70,7 @@ interface ButtonState {
}
interface LabelRadioItemProps {
- labelId: string;
+ labelText: { description: string; explanation?: string[] };
labelValue: number;
clickHandler: (newVal: number) => unknown;
states: ButtonState[];
@@ -63,7 +88,27 @@ const LabelRadioItem = (props: LabelRadioItemProps) => {
{props.states.map((item, idx) => (
diff --git a/website/src/components/Tasks/LabelTask/LabelTask.tsx b/website/src/components/Tasks/LabelTask/LabelTask.tsx
index 9dc36397..7299732e 100644
--- a/website/src/components/Tasks/LabelTask/LabelTask.tsx
+++ b/website/src/components/Tasks/LabelTask/LabelTask.tsx
@@ -69,7 +69,7 @@ export const LabelTask = ({
)}
>
- {valid_labels.length === 1 ? (
+ {task.mode === "simple" ? (
) : (
diff --git a/website/src/components/Tasks/Task/Task.tsx b/website/src/components/Tasks/Task/Task.tsx
index 0c728a6d..05410d4e 100644
--- a/website/src/components/Tasks/Task/Task.tsx
+++ b/website/src/components/Tasks/Task/Task.tsx
@@ -27,7 +27,7 @@ export const Task = ({ frontendId, task, trigger, mutate }) => {
const replyContent = useRef(null);
const [showUnchangedWarning, setShowUnchangedWarning] = useState(false);
- const taskType = TaskTypes.find((taskType) => taskType.type === task.type);
+ const taskType = TaskTypes.find((taskType) => taskType.type === task.type && taskType.mode === task.mode);
const { trigger: sendRejection } = useSWRMutation("/api/reject_task", post, {
onSuccess: async () => {
diff --git a/website/src/components/Tasks/TaskTypes.tsx b/website/src/components/Tasks/TaskTypes.tsx
index 6f0bd2e1..4a85ccbd 100644
--- a/website/src/components/Tasks/TaskTypes.tsx
+++ b/website/src/components/Tasks/TaskTypes.tsx
@@ -11,6 +11,7 @@ export interface TaskInfo {
category: TaskCategory;
pathname: string;
type: string;
+ mode?: string;
overview?: string;
instruction?: string;
update_type: string;
@@ -90,7 +91,7 @@ export const TaskTypes: TaskInfo[] = [
unchanged_title: "Order Unchanged",
unchanged_message: "You have not changed the order of the prompts. Are you sure you would like to continue?",
},
- // label
+ // label (full)
{
label: "Label Initial Prompt",
desc: "Provide labels for a prompt.",
@@ -98,6 +99,7 @@ export const TaskTypes: TaskInfo[] = [
pathname: "/label/label_initial_prompt",
overview: "Provide labels for the following prompt",
type: "label_initial_prompt",
+ mode: "full",
update_type: "text_labels",
},
{
@@ -105,8 +107,9 @@ export const TaskTypes: TaskInfo[] = [
desc: "Provide labels for a prompt.",
category: TaskCategory.Label,
pathname: "/label/label_prompter_reply",
- overview: "Given the following discussion, provide labels for the final promp",
+ overview: "Given the following discussion, provide labels for the final prompt",
type: "label_prompter_reply",
+ mode: "full",
update_type: "text_labels",
},
{
@@ -116,6 +119,38 @@ export const TaskTypes: TaskInfo[] = [
pathname: "/label/label_assistant_reply",
overview: "Given the following discussion, provide labels for the final prompt.",
type: "label_assistant_reply",
+ mode: "full",
+ update_type: "text_labels",
+ },
+ // label (simple)
+ {
+ label: "Classify Initial Prompt",
+ desc: "Provide labels for a prompt.",
+ category: TaskCategory.Label,
+ pathname: "/label/label_initial_prompt",
+ overview: "Read the following prompt and then answer the question about it.",
+ type: "label_initial_prompt",
+ mode: "simple",
+ update_type: "text_labels",
+ },
+ {
+ label: "Classify Prompter Reply",
+ desc: "Provide labels for a prompt.",
+ category: TaskCategory.Label,
+ pathname: "/label/label_prompter_reply",
+ overview: "Read the following conversation and then answer the question about the last prompt in the discussion.",
+ type: "label_prompter_reply",
+ mode: "simple",
+ update_type: "text_labels",
+ },
+ {
+ label: "Classify Assistant Reply",
+ desc: "Provide labels for a prompt.",
+ category: TaskCategory.Label,
+ pathname: "/label/label_assistant_reply",
+ overview: "Read the following conversation and then answer the question about the last prompt in the discussion.",
+ type: "label_assistant_reply",
+ mode: "simple",
update_type: "text_labels",
},
];
diff --git a/website/src/lib/oasst_api_client.ts b/website/src/lib/oasst_api_client.ts
index 0268b6d2..fb11adec 100644
--- a/website/src/lib/oasst_api_client.ts
+++ b/website/src/lib/oasst_api_client.ts
@@ -176,7 +176,7 @@ export class OasstApiClient {
const params = new URLSearchParams();
params.append("max_count", max_count.toString());
- // The backend API uses different query paramters depending on the
+ // The backend API uses different query parameters depending on the
// pagination direction but they both take the same cursor value.
// Depending on direction, pick the right query param.
if (cursor !== "") {
diff --git a/website/src/pages/404.tsx b/website/src/pages/404.tsx
index c3d01510..f4c09bbf 100644
--- a/website/src/pages/404.tsx
+++ b/website/src/pages/404.tsx
@@ -6,9 +6,6 @@ import { PageEmptyState } from "src/components/EmptyState";
import { getTransparentHeaderLayout } from "src/components/Layout";
function Error() {
- const router = useRouter();
- const backgroundColor = useColorModeValue("white", "gray.800");
-
return (
<>
diff --git a/website/src/pages/admin/manage_user/[id].tsx b/website/src/pages/admin/manage_user/[id].tsx
index ca7e087c..88bfced4 100644
--- a/website/src/pages/admin/manage_user/[id].tsx
+++ b/website/src/pages/admin/manage_user/[id].tsx
@@ -1,18 +1,28 @@
-import { Button, Container, FormControl, FormLabel, Input, Stack, useToast } from "@chakra-ui/react";
-import { Field, Form, Formik } from "formik";
+import { Button, Card, CardBody, Container, FormControl, FormLabel, Input, Stack, useToast } from "@chakra-ui/react";
+import { InferGetServerSidePropsType } from "next";
import Head from "next/head";
import { useRouter } from "next/router";
import { useSession } from "next-auth/react";
import { useEffect } from "react";
+import { useForm } from "react-hook-form";
import { getAdminLayout } from "src/components/Layout";
-import { RoleSelect } from "src/components/RoleSelect";
+import { Role, RoleSelect } from "src/components/RoleSelect";
import { UserMessagesCell } from "src/components/UserMessagesCell";
import { post } from "src/lib/api";
import { oasstApiClient } from "src/lib/oasst_api_client";
import prisma from "src/lib/prismadb";
import useSWRMutation from "swr/mutation";
-const ManageUser = ({ user }) => {
+interface UserForm {
+ user_id: string;
+ id: string;
+ auth_method: string;
+ display_name: string;
+ role: Role;
+ notes: string;
+}
+
+const ManageUser = ({ user }: InferGetServerSidePropsType) => {
const toast = useToast();
const router = useRouter();
const { data: session, status } = useSession();
@@ -52,6 +62,10 @@ const ManageUser = ({ user }) => {
},
});
+ const { register, handleSubmit } = useForm({
+ defaultValues: user,
+ });
+
return (
<>
@@ -62,46 +76,31 @@ const ManageUser = ({ user }) => {
/>
-
- {
- trigger(values);
- }}
- >
-
-
+
+
+
+
+
+
@@ -122,7 +121,7 @@ export async function getServerSideProps({ query }) {
});
const user = {
...backend_user,
- role: local_user?.role || "general",
+ role: (local_user?.role || "general") as Role,
};
return {
props: {
diff --git a/website/src/pages/api/leaderboard.ts b/website/src/pages/api/leaderboard.ts
index 10a9a3a7..592f3da5 100644
--- a/website/src/pages/api/leaderboard.ts
+++ b/website/src/pages/api/leaderboard.ts
@@ -6,7 +6,7 @@ import { LeaderboardTimeFrame } from "src/types/Leaderboard";
* Returns the set of valid labels that can be applied to messages.
*/
const handler = withoutRole("banned", async (req, res) => {
- const time_frame = req.query.time_frame as LeaderboardTimeFrame;
+ const time_frame = (req.query.time_frame as LeaderboardTimeFrame) || LeaderboardTimeFrame.day;
const { leaderboard } = await oasstApiClient.fetch_leaderboard(time_frame);
res.status(200).json(leaderboard);
});
diff --git a/website/src/pages/auth/signin.tsx b/website/src/pages/auth/signin.tsx
index ab1c74ca..bd442a65 100644
--- a/website/src/pages/auth/signin.tsx
+++ b/website/src/pages/auth/signin.tsx
@@ -42,7 +42,7 @@ const errorMessages: Record = {
interface SigninProps {
providers: Awaited>;
}
-// eslint-disable-next-line @typescript-eslint/no-unused-vars
+
function Signin({ providers }: SigninProps) {
const router = useRouter();
const { discord, email, github, credentials } = providers;
diff --git a/website/src/pages/create/initial_prompt.tsx b/website/src/pages/create/initial_prompt.tsx
index dc4429d0..6a51ca25 100644
--- a/website/src/pages/create/initial_prompt.tsx
+++ b/website/src/pages/create/initial_prompt.tsx
@@ -19,8 +19,8 @@ const InitialPrompt = () => {
return (
<>
- Reply as Assistant
-
+ Initial Prompt
+
>
diff --git a/website/src/pages/create/user_reply.tsx b/website/src/pages/create/user_reply.tsx
index b28b7442..8d2981e5 100644
--- a/website/src/pages/create/user_reply.tsx
+++ b/website/src/pages/create/user_reply.tsx
@@ -19,8 +19,8 @@ const UserReply = () => {
return (
<>
- Reply as Assistant
-
+ Reply as User
+
>
diff --git a/website/src/pages/dashboard.tsx b/website/src/pages/dashboard.tsx
index 42481f1e..3971e125 100644
--- a/website/src/pages/dashboard.tsx
+++ b/website/src/pages/dashboard.tsx
@@ -1,3 +1,4 @@
+import { Flex } from "@chakra-ui/react";
import Head from "next/head";
import { useSession } from "next-auth/react";
import { LeaderboardTable, TaskOption } from "src/components/Dashboard";
@@ -16,8 +17,10 @@ const Dashboard = () => {
Dashboard - Open Assistant
-
-
+
+
+
+
>
);
};
diff --git a/website/src/pages/leaderboard.tsx b/website/src/pages/leaderboard.tsx
index 131778c9..e53b0c52 100644
--- a/website/src/pages/leaderboard.tsx
+++ b/website/src/pages/leaderboard.tsx
@@ -1,4 +1,4 @@
-import { Box, Heading, Tabs, TabList, TabPanels, Tab, TabPanel } from "@chakra-ui/react";
+import { Box, Heading, Tab, TabList, TabPanel, TabPanels, Tabs } from "@chakra-ui/react";
import Head from "next/head";
import { getDashboardLayout } from "src/components/Layout";
import { LeaderboardGridCell } from "src/components/LeaderboardGridCell";
diff --git a/website/src/pages/privacy-policy.tsx b/website/src/pages/privacy-policy.tsx
index cac820fb..1c94b669 100644
--- a/website/src/pages/privacy-policy.tsx
+++ b/website/src/pages/privacy-policy.tsx
@@ -88,7 +88,7 @@ const PrivacyPolicy = () => {
{
number: "4",
title: "Inquiries",
- desc: "When you contact us via e-mail, telephone or telefax, your inquiry, including all personal data arising thereof will be stored by us for the purpose of processing your request. We will not pass on these data without your consent. The processing of these data is based on Article 6 (1) (1) (b) GDPR, if your inquiry is related to the fulfilment of a contract concluded with us or required for the implementation of pre-contractual measures. Furthermore, the processing is based on Article 6 (1) (1) (f) GDPR, because we have a legitimate interest in the effective handling of requests sent to us. In addition, according to Article 6 (1) (1) (c) GDPR we are also entitled to the processing of the above-mentioned data, because we are legally bound to enable fast electronic contact and immediate communication. Of course, your data will only be used strictly according to purpose and only for processing and responding to your request. After final processing, your data will immediately be anonymized or deleted, unless we are bound by a legally prescribed storage period.",
+ desc: "When you contact us via e-mail, telephone or telefax, your inquiry, including all personal data arising thereof will be stored by us for the purpose of processing your request. We will not pass on these data without your consent. The processing of these data is based on Article 6 (1) (1) (b) GDPR, if your inquiry is related to the fulfillment of a contract concluded with us or required for the implementation of pre-contractual measures. Furthermore, the processing is based on Article 6 (1) (1) (f) GDPR, because we have a legitimate interest in the effective handling of requests sent to us. In addition, according to Article 6 (1) (1) (c) GDPR we are also entitled to the processing of the above-mentioned data, because we are legally bound to enable fast electronic contact and immediate communication. Of course, your data will only be used strictly according to purpose and only for processing and responding to your request. After final processing, your data will immediately be anonymized or deleted, unless we are bound by a legally prescribed storage period.",
sections: [],
},
{
diff --git a/website/src/pages/terms-of-service.tsx b/website/src/pages/terms-of-service.tsx
index f58a9084..b0e298ba 100644
--- a/website/src/pages/terms-of-service.tsx
+++ b/website/src/pages/terms-of-service.tsx
@@ -14,7 +14,7 @@ const TermsOfService = () => {
{
number: "1.1",
title: "",
- desc: `LAION (association in formation), Marie-Henning-Weg 143, 21035 Hamburg (hereinafter referred to as: "LAION") operates an online portal for the producing a machine learning model called Open Assistant using crowdsourced data.`,
+ desc: `LAION (association in formation), Marie-Henning-Weg 143, 21035 Hamburg (hereinafter referred to as: "LAION") operates an online portal for the producing a machine learning model called Open Assistant using crowd-sourced data.`,
},
{
number: "1.2",
diff --git a/website/src/styles/Home.module.css b/website/src/styles/Home.module.css
deleted file mode 100644
index e69de29b..00000000
diff --git a/website/src/styles/Theme/components/Card.ts b/website/src/styles/Theme/components/Card.ts
new file mode 100644
index 00000000..8cd66031
--- /dev/null
+++ b/website/src/styles/Theme/components/Card.ts
@@ -0,0 +1,27 @@
+import { cardAnatomy } from "@chakra-ui/anatomy";
+import { createMultiStyleConfigHelpers } from "@chakra-ui/react";
+
+const { definePartsStyle, defineMultiStyleConfig } = createMultiStyleConfigHelpers(cardAnatomy.keys);
+
+export const cardTheme = defineMultiStyleConfig({
+ baseStyle: definePartsStyle(({ colorMode }) => {
+ const isLightMode = colorMode === "light";
+ return {
+ container: {
+ backgroundColor: isLightMode ? "white" : "gray.700",
+ },
+ header: {},
+ body: {
+ padding: 6,
+ },
+ footer: {},
+ };
+ }),
+ variants: {
+ elevated: definePartsStyle({
+ container: {
+ borderRadius: "xl",
+ },
+ }),
+ },
+});
diff --git a/website/src/styles/Theme/index.ts b/website/src/styles/Theme/index.ts
index 718eab7f..37ca424d 100644
--- a/website/src/styles/Theme/index.ts
+++ b/website/src/styles/Theme/index.ts
@@ -2,6 +2,7 @@ import { type ThemeConfig, extendTheme } from "@chakra-ui/react";
import { Styles } from "@chakra-ui/theme-tools";
import { colors } from "./colors";
+import { cardTheme } from "./components/Card";
import { containerTheme } from "./components/Container";
const config: ThemeConfig = {
@@ -12,6 +13,7 @@ const config: ThemeConfig = {
const components = {
Container: containerTheme,
+ Card: cardTheme,
};
const breakpoints = {