content.raw: Evaluate RAG using Open Source from HuggingFace using BeyondLLM
content.type: text
content.value: Evaluate RAG using Open Source from HuggingFace using BeyondLLM
content.type: new_line
content.type: new_line
content.code: # pip install beyondllm
  # pip install huggingface_hub
  # pip install llama-index-embeddings-fastembed
  
  from beyondllm.source import fit
  from beyondllm.embeddings import FastEmbedEmbeddings
  from beyondllm.retrieve import auto_retriever
  from beyondllm.llms import HuggingFaceHubModel
  from beyondllm.generator import Generate
  
  import os
  from getpass import getpass
  os.environ['HUGGINGFACE_ACCESS_TOKEN'] = getpass("Enter your HF API token:")
  
  data = fit("RedHenLab_GSoC_Tarun.pdf",dtype="pdf")
  embed_model = FastEmbedEmbeddings()
  retriever = auto_retriever(data=data,embed_model=embed_model,type="normal",top_k=3)
  llm = HuggingFaceHubModel(model="mistralai/Mistral-7B-Instruct-v0.2")
  pipeline = Generate(question="what models has Tarun fine-tuned?",llm=llm,retriever=retriever)
  
  print(pipeline.call()) # Return the AI response
  print(pipeline.get_rag_triad_evals())
content.raw: ```
  # pip install beyondllm
  # pip install huggingface_hub
  # pip install llama-index-embeddings-fastembed
  
  from beyondllm.source import fit
  from beyondllm.embeddings import FastEmbedEmbeddings
  from beyondllm.retrieve import auto_retriever
  from beyondllm.llms import HuggingFaceHubModel
  from beyondllm.generator import Generate
  
  import os
  from getpass import getpass
  os.environ['HUGGINGFACE_ACCESS_TOKEN'] = getpass("Enter your HF API token:")
  
  data = fit("RedHenLab_GSoC_Tarun.pdf",dtype="pdf")
  embed_model = FastEmbedEmbeddings()
  retriever = auto_retriever(data=data,embed_model=embed_model,type="normal",top_k=3)
  llm = HuggingFaceHubModel(model="mistralai/Mistral-7B-Instruct-v0.2")
  pipeline = Generate(question="what models has Tarun fine-tuned?",llm=llm,retriever=retriever)
  
  print(pipeline.call()) # Return the AI response
  print(pipeline.get_rag_triad_evals())
  ```
content.type: code_fence
content.type: new_line
content.type: new_line
content.raw: GitHub: 
content.type: text
content.value: GitHub: 
content.href: https://github.com/aiplanethub/beyondllm
content.raw: https://github.com/aiplanethub/beyondllm
content.type: link
content.type: new_line
content.type: new_line
content.raw: Don't forget to ⭐️ the repo
content.type: text
content.value: Don't forget to ⭐️ the repo
rawContent: Evaluate RAG using Open Source from HuggingFace using BeyondLLM
  
  ```
  # pip install beyondllm
  # pip install huggingface_hub
  # pip install llama-index-embeddings-fastembed
  
  from beyondllm.source import fit
  from beyondllm.embeddings import FastEmbedEmbeddings
  from beyondllm.retrieve import auto_retriever
  from beyondllm.llms import HuggingFaceHubModel
  from beyondllm.generator import Generate
  
  import os
  from getpass import getpass
  os.environ['HUGGINGFACE_ACCESS_TOKEN'] = getpass("Enter your HF API token:")
  
  data = fit("RedHenLab_GSoC_Tarun.pdf",dtype="pdf")
  embed_model = FastEmbedEmbeddings()
  retriever = auto_retriever(data=data,embed_model=embed_model,type="normal",top_k=3)
  llm = HuggingFaceHubModel(model="mistralai/Mistral-7B-Instruct-v0.2")
  pipeline = Generate(question="what models has Tarun fine-tuned?",llm=llm,retriever=retriever)
  
  print(pipeline.call()) # Return the AI response
  print(pipeline.get_rag_triad_evals())
  ```
  
  GitHub: https://github.com/aiplanethub/beyondllm
  
  Don't forget to ⭐️ the repo
reactions.reaction: 🔥
reactions.users: fdaudens radames orkut simkjels umutphp victor thesven sadra-barikbin
reactions.reaction: 👀
reactions.users: victor simkjels GPT007 thesven
commentators._id: 5f17f0a0925b9863e28ad517
commentators.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/5f17f0a0925b9863e28ad517/fXIY5i9RLsIa1v3CCuVtt.jpeg
commentators.fullname: Victor Mustar
commentators.name: victor
commentators.type: user
commentators._id: 65f0d05cfd7e9976e3dcfffe
commentators.avatarUrl: /avatars/c574b7c7ace902c4a613373d3a64e381.svg
commentators.fullname: Pavan Satish
commentators.name: Pavansatish
commentators.type: user
commentators._id: 630f3058236215d0b7078806
commentators.avatarUrl: https://cdn-avatars.huggingface.co/v1/production/uploads/630f3058236215d0b7078806/TRTdqAZpT1bJg_RvGgxlg.jpeg
commentators.fullname: Tarun Jain
commentators.name: lucifertrj
commentators.type: user