Hello again, still trying to estimate the costs, I see some strange things,
This is my code:
(Only called first time):
def train(path):
tokens = 0
name = path.split("/")[-1]
# get the documents inside the folder
documents = SimpleDirectoryReader(path).load_data()
print("Starting Vector construction at ", datetime.datetime.now())
index = GPTSimpleVectorIndex.from_documents(documents)
index.save_to_disk("indexes/" + name + ".json")
return tokens
Now, I just call this another method:
def query(query, toIndex):
index = GPTSimpleVectorIndex.load_from_disk("indexes/" + toIndex + ".json")
response = index.query(query)
return response
response = query("question", "data")
This is what the console output says:
INFO:llama_index.token_counter.token_counter:> [query] Total LLM token usage: 5002 tokens
INFO:llama_index.token_counter.token_counter:> [query] Total embedding token usage: 23 tokens
But this is what OpenAI billing console says:
11:35
Local time: 30 mar 2023, 13:35
text-davinci, 2 requests
4,483 prompt + 512 completion = 4,995 tokens
11:35
Local time: 30 mar 2023, 13:35
text-embedding-ada-002-v2, 2 requests
56,906 prompt + 0 completion = 56,906 tokens
is that right? 🤔