From ebeba0cfbb7a17640c55216492496d6224cb1da9 Mon Sep 17 00:00:00 2001 From: Fraser Date: Sat, 1 Apr 2023 03:22:00 -0400 Subject: [PATCH] fix margin --- api/chat.py | 7 ++++--- web/src/header.tsx | 2 +- web/src/pages/index.tsx | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/chat.py b/api/chat.py index 67d7589..fb5378e 100644 --- a/api/chat.py +++ b/api/chat.py @@ -28,6 +28,7 @@ def limit_tokens(text: str, max_tokens: int, encoding_name: str = "cl100k_base") return encoding.decode(tokens) def construct_prompt(query: str, history: List[Dict[str, str]], context: List[Block], encoding_name: str = "cl100k_base"): + # History takes the format: history=[ # {"role": "system", "content": "You are a helpful assistant."}, # {"role": "user", "content": "Who won the world series in 2020?"}, @@ -112,9 +113,9 @@ def talk_to_robot(dataset_dict, query: str, history: List[Dict[str, str]] = [], # 2. Generate a prompt for the ChatCompletions API prompt, max_tokens_completion = construct_prompt(query, history, top_k_blocks) - print(" ------------------------------ prompt: -----------------------------") - for message in prompt: - print(f"{message['role']}: {message['content']}\n\n") + # print(" ------------------------------ prompt: -----------------------------") + # for message in prompt: + # print(f"{message['role']}: {message['content']}\n\n") # if we were to error out, return something like this # return (False, "Example error message", None) diff --git a/web/src/header.tsx b/web/src/header.tsx index 059a96e..46320a7 100644 --- a/web/src/header.tsx +++ b/web/src/header.tsx @@ -16,7 +16,7 @@ const Header: React.FC<{page: "index" | "semantic"}> = ({page}) => { return (<>
-

Alignment Search

+

AlignmentSearch

{sidebar}

diff --git a/web/src/pages/index.tsx b/web/src/pages/index.tsx index 5a76ec2..dee86c5 100644 --- a/web/src/pages/index.tsx +++ b/web/src/pages/index.tsx @@ -87,7 +87,7 @@ const ShowEntry: React.FC<{entry: Entry}> = ({entry}) => { // system reply return ( -

+
{ // split into paragraphs entry.display_content.split("\n").map(paragraph => (

{ paragraph.split(in_text_citation_regex).map((text, i) => {