Skip to content

Commit

Permalink
cookbook for beyondllm
Browse files Browse the repository at this point in the history
  • Loading branch information
tarun-aiplanet committed Apr 21, 2024
1 parent 59f0513 commit 202bae8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cookbook/open_source_evaluation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# pip install beyondllm
# pip install ollama
# pip install llama-index-embeddings-fastembed
from beyondllm import source,retrieve,generator
from beyondllm.llms import OllamaModel
from beyondllm.embeddings import FastEmbedEmbeddings

query = "what is Tarun's role at AI Planet?"
data = source.fit(path="https://tarunjain.netlify.app", dtype="url",chunk_size=1024)
retriever = retrieve.auto_retriever(data,embed_model=FastEmbedEmbeddings(),type="normal")
pipeline = generator.Generate(question=query,llm=OllamaModel(model="llama2"),retriever=retriever)

print(pipeline.call())
print(pipeline.get_rag_triad_evals())

0 comments on commit 202bae8

Please sign in to comment.