Find answers from the community

Updated last year

it is downloading another model for some

it is downloading another model for some reason... could it be that the Llama2 model I converted with llama.cpp wasn't compatable? also after it spits out a lot of llm stat info I noticed it saying "Could not load OpenAIEmbedding. Using HuggingFaceBgeEmbeddings with model_name=BAAI/bge-small-en. If you intended to use OpenAI, please check your OPENAI_API_KEY." then after downloading tokenizer and other stuff from huggingface it said "Could not load OpenAI model. Using default LlamaCPP=llama2-13b-chat. If you intended to use OpenAI, please check your OPENAI_API_KEY." then started downloading the new model from huggingface. ... πŸ€¦β€β™‚οΈ does that sound about rite? lol
L
M
15 comments
If you don't have an openai key set, it falls back to BAAI/bge-small-en for embeddings model and llama2-chat-13b for the LLM

You need to properly setup your service context to avoid this, or set your openai key
im trying to run a local llm lol
How did you setup your service context?
Plain Text
query_engine = index.as_query_engine(service_context=service_context) ... that?
im sorry im still learning python and i was trying to follow the docs here https://docs.llamaindex.ai/en/stable/getting_started/customization.html


Hmm, Try passing it into the index creation instead. Or just set a global tbh

Plain Text
from llama_index import set_global_service_context

set_global_service_context(service_context)
dangit wrong window ..
query_engine = index.as_query_engine(service_context=service_context) ... that?
Yea close, it should probably just be a global instead, or pass it into the index creation

Plain Text
from llama_index import set_global_service_context

set_global_service_context(service_context)

# OR
index = VectorStoreIndex.from_documents(documents, service_context=service_context)
this is my .py
import os
from langchain.llms import LlamaCpp
from llama_index import ServiceContext
from llama_index import VectorStoreIndex, SimpleDirectoryReader, LLMPredictor

Set up the LLM model options

llm = LlamaCpp(
model_path="models/bob-34b/ggml-model-q4_0.gguf",
temperature=0.1,
max_tokens=2000,
top_p=1,
verbose=True,
)

llm_predictor = LLMPredictor(llm=llm)


Load documents and build index

documents = SimpleDirectoryReader('KnowledgeBase/pdf/', recursive=True, exclude_hidden=True).load_data()

Create a ServiceContext instance with the custom tokenizer

service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor)
index = VectorStoreIndex.from_documents(documents)

Query index

query_engine = index.as_query_engine(service_context=service_context)
response = query_engine.query("what is python?")

Print the response

print(response)
let me try this
lets see what that does lol
im not sure it looses me here because there is no line error...
and i dont get why its trying to use openai when im giving it a llama2
Like I mentioned above, either set it as a global or pass it into the index creation

https://discord.com/channels/1059199217496772688/1162896173573619732/1162904899210715228
Add a reply
Sign up and join the conversation on Discord