Skip to content

Commit

Permalink
Update viz
Browse files Browse the repository at this point in the history
  • Loading branch information
rlancemartin committed Mar 9, 2024
1 parent 99f02aa commit 97d9f4e
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 264 deletions.
3 changes: 3 additions & 0 deletions src/llm_multi_needle_haystack_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ async def insert_needles(self, context, depth_percent, context_length):
# To evenly distribute the needles, we calculate the intervals they need to be inserted.
depth_percent_interval = (100 - depth_percent) / len(self.needles)

# Reset the insertion percentages list for the current context
self.insertion_percentages = []

# Insert needles at calculated points
for needle in self.needles:

Expand Down
13 changes: 9 additions & 4 deletions src/providers/anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,16 @@ def get_langchain_runnable(self, context: str) -> str:
- Execute the runnable with these parameters to get the model's response.
"""

template = """You are a helpful AI bot that answers questions for a user. Keep your response short and direct" \n
\n ------- \n
template = """Human: You are a helpful AI bot that answers questions for a user. Keep your response short and direct" \n
<document_content>
{context}
\n ------- \n
Here is the user question: \n --- --- --- \n {question} \n Don't give information outside the document or repeat your findings."""
</document_content>
Here is the user question:
<question>
{question}
</question>
Don't give information outside the document or repeat your findings.
Assistant: Here is the most relevant information in the documents:"""

prompt = PromptTemplate(
template=template,
Expand Down
425 changes: 165 additions & 260 deletions viz/CreateVisFromLangSmithTesting.ipynb

Large diffs are not rendered by default.

0 comments on commit 97d9f4e

Please sign in to comment.