Find answers from the community

Home
Members
AlexDep
A
AlexDep
Offline, last seen 3 months ago
Joined September 25, 2024
Plain Text
prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit)

    llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.7, model_name="gpt-3.5-turbo", max_tokens=num_outputs))
    
    sc = ServiceContext.from_defaults(llm_predictor=llm_predictor, prompt_helper=prompt_helper)

    download_loader('SimpleDirectoryReader')
    documents = SimpleDirectoryReader(input_files=[file_path]).load_data()
    index = GPTVectorStoreIndex.from_documents(documents, service_context=sc)
    
   

    # save
    storage_context = StorageContext.from_defaults(persist_dir="./storage")
    # load
    index = load_index_from_storage(storage_context)
    
    return index

index = build_index(file_path=file_path)  

query_engine = index.as_query_engine(similarity_top_k=5)
14 comments
L
m
A
Hi everybody. Does everyone have such a mistake or is it just me? ERROR: WARNING:langchain.chat_models.openai:Retry langchain.chat_models.openai.ChatOpenAI.completion with repetition.<locals>._completion_with_retry after 1.0 seconds, as this caused ServiceUnavailableError: the server is overloaded or not ready yet..
2 comments
A
L
A
AlexDep
Β·

Install

guys need help. The libraries are all installed, but the error : from llama_index import SimpleDirectoryReader, GPTListIndex, readers, GPTSimpleVectorIndex, LLMPredictor, PromptHelper
ModuleNotFoundError: No module named 'llama_index'
32 comments
A
L
a