Questions tagged [llama-index]
112 questions
8
votes
2 answers
How to restrict llama_index queries to respond only from local data
As given in https://gpt-index.readthedocs.io/en/latest/guides/tutorials/building_a_chatbot.html we wrote a chatbot to index our reference materials and it works fine. The biggest issue it has is that the bot sometimes respond to questions with its…

Ishan Hettiarachchi
- 1,426
- 2
- 19
- 31
8
votes
2 answers
Llama_index unexpected keyword argument error on ChatGPT Model Python
I'm testing a couple of the widely published GPT models just trying to get my feet wet and I am running into an error that I cannot solve.
I am running this code:
from llama_index import SimpleDirectoryReader, GPTListIndex, GPTSimpleVectorIndex,…

t25
- 167
- 3
- 14
7
votes
1 answer
How to add 'message history' to llama-index based GPT-3 in Python
I am fairly new to using llama-index library for training GPT-3 as well as using ChatGPT through the standard API (both in Python). I have noticed that standard ChatGPT API i could simply do the following code below to have ChatGPT get message…

Lawrd_Das
- 71
- 3
6
votes
2 answers
llama_index get the document referenced from node_sources
I'm getting good results with llama_index having indexed PDFs, however I am having trouble finding which PDF it found the results in to base its answers upon. result.node_sources uses a Doc id which it seems to internally generate. How can I get a…

edencorbin
- 2,569
- 5
- 29
- 44
4
votes
2 answers
Why does llama-index still require an OpenAI key when using Hugging Face local embedding model?
I am creating a very simple question and answer app based on documents using llama-index. Previously, I had it working with OpenAI. Now I want to try using no external APIs so I'm trying the Hugging Face example in this link.
It says in the example…

Mikey A. Leonetti
- 2,834
- 3
- 22
- 36
4
votes
2 answers
How to load a fine-tuned peft/lora model based on llama with Huggingface transformers?
I've followed this tutorial (colab notebook) in order to finetune my model.
Trying to load my locally saved model
model = AutoModelForCausalLM.from_pretrained("finetuned_model")
yields Killed.
Trying to load model from hub:
yields
import…

Lucas Azevedo
- 1,867
- 22
- 39
4
votes
5 answers
Why do I get an openai.error.AuthenticationError when using llama-index despite my key is valid?
I'm using llama-index with the following code:
import os
from llama_index import VectorStoreIndex, SimpleDirectoryReader
os.environ["OPENAI_API_KEY"] = 'MY_KEY'
documents = SimpleDirectoryReader('data').load_data()
index =…

Vincent
- 1,013
- 14
- 33
4
votes
1 answer
Use LlamaIndex with different embeddings model
OpenAI's GPT embedding models are used across all LlamaIndex examples, even though they seem to be the most expensive and worst performing embedding models compared to T5 and sentence-transformers models (see comparison below).
How do I use…

Jay
- 1,564
- 16
- 24
4
votes
1 answer
LlamaIndex with ChatGPT taking too long to retrieve answers
I am currently working on a chatbot for our website that provides domain knowledge using LlamaIndex and chatGPT. Our chatbot uses around 50 documents, each around 1-2 pages long, containing tutorials and other information from our site. While the…

Aggamarcel
- 41
- 4
4
votes
3 answers
ImportError: cannot import name 'LLaMATokenizer' from 'transformers'
I am not able to import LLaMATokenizer
Any solution for this problem?
I am using the code of this repo.
https://github.com/zphang/transformers/tree/llama_push
and trying to load the models and tokenizer using
tokenizer =…

ScrapperMaster
- 47
- 1
- 1
- 3
3
votes
0 answers
Why do I get an inconsistent memory error when loading Llama-2 from huggingface
I'm playing around with the new Llama-2 7B model, and running it on a 16GM RAM M1 pro Mac. If I load the model, Python crashes with a memory error - unless I load it via hf pipelines. I don't believe this to be a hf issue but rather something weird…

Max Niroomand
- 61
- 3
3
votes
2 answers
RateLimit error llama_index code with openai api key
My code is
import os
import sys
import transformers
from transformers import AutoModelForSequenceClassification, AutoTokenizer
from llama_index import Document, GPTVectorStoreIndex
os.environ['OPENAI_API_KEY'] = 'my-openapi-key'
# Load the…

Ankit Bansal
- 2,162
- 8
- 42
- 79
3
votes
1 answer
How can I index the tables along with texts present in the pdf using Llamaindex and LangChain? (i am using Openai key)
def ask(file):
print(" Loading...")
PDFReader = download_loader("PDFReader")
loader = PDFReader()
documents = loader.load_data(file=Path(file))
print("Path: ", Path(file))
# Check if the index file exists
if…

Harshit
- 41
- 2
3
votes
2 answers
How does LlaMA index select nodes based on the query text?
When I query a simple vector index created using a LlaMA index, it returns a JSON object that has the response for the query and the source nodes (with the score) it used to generate an answer. How does it calculate which nodes to use? (I'm guessing…

shardgon
- 33
- 2
2
votes
1 answer
PydanticUserError: If you use `@root_validator` with pre=False (the default) you MUST specify `skip_on_failure=True`
I want to execute this code in google colab but I get following error:
from llama_index.prompts.prompts import SimpleInputPrompt
# Create a system prompt
system_prompt = """[INST] <>
more string here.<>
"""
query_wrapper_prompt =…

Christian01
- 307
- 1
- 5
- 19