mirror of
https://github.com/wassname/stampy-chat.git
synced 2026-09-12 13:00:42 +08:00
fix margin
This commit is contained in:
+4
-3
@@ -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)
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ const Header: React.FC<{page: "index" | "semantic"}> = ({page}) => {
|
||||
|
||||
return (<>
|
||||
<div className="flex my-4">
|
||||
<h1 className="flex-1 my-0">Alignment Search</h1>
|
||||
<h1 className="flex-1 my-0">AlignmentSearch</h1>
|
||||
{sidebar}
|
||||
</div>
|
||||
<p>
|
||||
|
||||
@@ -87,7 +87,7 @@ const ShowEntry: React.FC<{entry: Entry}> = ({entry}) => {
|
||||
|
||||
// system reply
|
||||
return (
|
||||
<div className="my-3">
|
||||
<div className="mt-3 mb-8">
|
||||
{ // split into paragraphs
|
||||
entry.display_content.split("\n").map(paragraph => ( <p> {
|
||||
paragraph.split(in_text_citation_regex).map((text, i) => {
|
||||
|
||||
Reference in New Issue
Block a user