Merge branch 'main' into level-modes

This commit is contained in:
FraserLee
2023-07-11 23:33:59 -04:00
committed by GitHub
4 changed files with 26 additions and 19 deletions
+8 -7
View File
@@ -23,9 +23,6 @@ In general, the Stampy project serves users at 3 levels of understanding:
Given the disparate backgrounds of users, for both the website and chatbot, we should consider having users identify their starting level (new, moderate, knowledgeable). On the website, the list of starter and recommended questions would be tuned to the users level. Similarly, the chatbot's usage of technical terminology could be adjusted to their level.
## Usage
### Environment Setup
@@ -58,10 +55,14 @@ npm run dev
In the second window, a URL will be printed. Probably `http://localhost:3000`.
Paste this into your browser to see the app.
### Accessing Dataset
If you'll be loading data alignment research dataset to be embedded and stored in pinecone,
you'll need to access to our [private version of the dataset](https://huggingface.co/datasets/StampyAI/ard-private).
1. Create a free [HuggingFace account](https://huggingface.co/join).
2. Give admin your account name to be added to the organization. DM ccstan on Discord.
3. Create an [access token](https://huggingface.co/settings/tokens).
4. Follow [login instructions](https://huggingface.co/docs/huggingface_hub/quick-start) to access private datasets.
## Original Prototypes
@@ -70,6 +71,6 @@ The teams collaborated and key features were combined into one project.
Name | Demo App | Code Notes
-- | -- | --
McGill's AlignmentSearch | https://alignmentsearch.up.railway.app/ | https://github.com/FraserLee/AlignmentSearch<br>https://tinyurl.com/alignmentsearchgdocs
McGill's AlignmentSearch | https://alignmentsearch.up.railway.app/ | https://github.com/FraserLee/AlignmentSearch<br>https://www.lesswrong.com/posts/bGn9ZjeuJCg7HkKBj/introducing-alignmentsearch-an-ai-alignment-informed
Craig's AlignmentGPT | http://tidblitz.com/ | https://github.com/cvarrichio/alignmentchat
Stampy's Chat | http://chat.stampy.ai/ | https://github.com/ccstan99/stampy-chat<br>https://github.com/stampyAI/stampy-nlp/
+6 -5
View File
@@ -1,22 +1,23 @@
import React from "react";
import Link from "next/link";
import Image from 'next/image';
import logo from "./logo.svg"
const Header: React.FC<{page: "index" | "semantic"}> = ({page}) => {
const sidebar = page === "index" ? (
<span className="flex flex-col font-semibold flex-1 justify-start text-right">
<p className="my-0">Conversational Agent</p>
<Link href="/semantic">Semantic Search</Link>
<Link href="/semantic">Show Sources</Link>
</span>
) : (
<span className="flex flex-col font-semibold flex-1 justify-start text-right">
<Link href="/">Conversational Agent</Link>
<p className="my-0">Semantic Search</p>
<Link href="/">Go Chat</Link>
</span>
);
return (<>
<div className="flex my-4">
<h1 className="flex-1 my-0">AlignmentSearch</h1>
<Image src={logo} alt="aisafety.info logo" width={36}/>
<h1 className="flex-1 my-0">AI Safety Chatbot</h1>
{sidebar}
</div>
</>);
+10 -5
View File
@@ -4,6 +4,7 @@ import Head from "next/head";
import React from "react";
import { type NextPage } from "next";
import { useState, useEffect } from "react";
import Link from "next/link";
import Image from 'next/image';
import Header from "../header";
@@ -72,9 +73,14 @@ const ShowCitation: React.FC<{citation: Citation, i: number}> = ({citation, i})
if (citation.date && citation.date !== "")
c_str += " - " + citation.date;
// if we don't have a url, link to a duckduckgo search for the title instead
const url = citation.url && citation.url !== ""
? citation.url
: `https://duckduckgo.com/?q=${encodeURIComponent(citation.title)}`;
return (
<A className={Colours[i % Colours.length] + " border-2 flex items-center rounded my-2 text-sm no-underline w-fit"}
href={citation.url}>
href={url}>
<span className="mx-1"> [{i + 1}] </span>
<p className="mx-1 my-0"> {c_str} </p>
</A>
@@ -474,7 +480,7 @@ const Home: NextPage = () => {
return (
<>
<Head>
<title>Alignment Search</title>
<title>AI Safety Info</title>
</Head>
<main>
<Header page="index" />
@@ -507,10 +513,9 @@ const Home: NextPage = () => {
</div>
<h2 className="bg-red-100 text-red-800"><b>WARNING</b>: This is a very <b>early prototype</b> using data through June 2022. <Link href="http://bit.ly/stampy-chat-issues" target="_blank">Feedback</Link> welcomed.</h2>
<ul>
{entries.map((entry, i) => {
switch (entry.role) {
+2 -2
View File
@@ -41,11 +41,11 @@ const Semantic: NextPage = () => {
return (
<>
<Head>
<title>Alignment Search</title>
<title>AI Safety Info</title>
</Head>
<main>
<Header page="semantic" />
<h2>See the raw results of a semantic search</h2>
<h2>Retrieve relevant data sources from alignment research</h2>
<SearchBox search={semantic_search} />
<ul>
{results.map((entry, i) => (