updated prices on other-talk

This commit is contained in:
locker98 2024-04-19 23:33:54 -04:00
parent 565ee99aac
commit 660bc0a734

View File

@ -43,7 +43,7 @@ def is_bulletpoint(s):
def generate_text(model, prompt, system=""): def generate_text(model, prompt, system=""):
url = "http://localhost:11434/api/generate" url = "http://100.:11434/api/generate"
data = { data = {
"model": model, "model": model,
"prompt": prompt, "prompt": prompt,
@ -139,12 +139,12 @@ for x in docs:
chunk_text = context chunk_text = context
system_prompt = """ system_prompt = """
You are a professional code summarizer. You will be be given a SQL query in chunk section. You are a professional summarizer. You will be be given a information in chunk section.
Take each chunk and create a very short concise single paragraph summery. The chunk will be under the # CHUNK heading. Only output the summery. Take each chunk and create a very short concise single paragraph summery. The chunk will be under the # CHUNK heading. Only output the summery.
Do not under any circumstance output the # CHUNK section, SQL code, or bullet points. Do not under any circumstance output the # CHUNK section, or bullet points.
""" """
prompt = f""" prompt = f"""
Write a paragraph summary of the following CHUNK of sql code. Write a paragraph summary of the following CHUNK of text.
# CHUNK # CHUNK
{chunk_text} {chunk_text}
@ -159,7 +159,7 @@ Write a paragraph summary of the following CHUNK of sql code.
bullet_point = True bullet_point = True
if is_bulletpoint(outline.split("\n")[0]): if is_bulletpoint(outline.split("\n")[0]):
outline = " The SQL script performs the following tasks:\n" + outline.replace("\n", "\n\t") outline = "The text contains the following information:\n" + outline.replace("\n", "\n\t")
elif bullet_point: elif bullet_point:
outline = outline.replace("\n", "\n\t") outline = outline.replace("\n", "\n\t")
else: else:
@ -179,10 +179,10 @@ print("Compression Ratio: ", round(len(nltk_tokens_init)/len(nltk_tokens), 1))
# Final Summary # Final Summary
system_prompt = "You are an expert summarizer. Your Job it to take all the individual sections under each bullet point. Make sure that the summary is long and detailed. Do not mention anything about sections or chunks and only summarize in paragraph form. Never let your summary's contain outlines or built points" system_prompt = "You are an expert summarizer. Your job is to take all the individual sections under each bullet point. Make sure that the summary is long and detailed. Do not mention anything about sections or chunks and only summarize in paragraph form. Never let your summary's contain outlines or built points"
prompt = f""" prompt = f"""
Here are a bunch of bulit points. Please summerize them: Here are a bunch of bulit points. Please summerize them in paragraph form:
{pre_summery} {pre_summery}
""" """
@ -193,7 +193,7 @@ final_summery = generate_text(model, prompt, system_prompt)
print("Done") print("Done")
pdf.add_section(Section(f"## Basic Overview\n{final_summery}\n\n")) pdf.add_section(Section(f"## Basic Overview\n{final_summery}\n\n"))
pdf.add_section(Section(f"## Code Outline\n{pre_summery}\n\n")) pdf.add_section(Section(f"## Outline\n{pre_summery}\n\n"))
pdf.meta["title"] = title pdf.meta["title"] = title
pdf.meta["author"] = "locker98" pdf.meta["author"] = "locker98"