Find answers from the community

m
meeffe
Offline, last seen 3 months ago
Joined September 25, 2024
m
meeffe
·

Hello,

Hello,
Update llama_index to be compatible with newest langchain 0.1 please; these import errors are driving me crazy
9 comments
m
L
Anyone could tell me why by using this exact code with gpt-4 as a model specified, I stil got usage only for gpt 3.5 turbo? How to use gpt-4 here?

https://github.com/aamyren/CalHacks2023/blob/133a8c144cfb925d400c125e37b60b5446d91e41/app.py#L3

I specified:
Plain Text
llm_predictor = LLMPredictor(
        llm=openai(temperature=0.7, model_name="gpt-4", max_tokens=num_outputs)
    )


but still it treat and use gpt 3.5 turbo from openai usage page
3 comments
W
m
E
Hello everyone,

I strugle with combining 2 data loaders into index. How to merge competitor_index with index to be able to query both at the same time? competitor_index uses bs4 data connector, index uses youtube data connector

Plain Text
from llama_index import (
    LLMPredictor,
    PromptHelper,
    ServiceContext,
    GPTSimpleVectorIndex,
    download_loader
)
from langchain.chat_models import ChatOpenAI
import os

os.environ["OPENAI_API_KEY"] = 'xxx'

max_input_size = 4096
num_output = 512
max_chunk_overlap = 200
temperature = 0

# define prompt helper
prompt_helper = PromptHelper(max_input_size, num_output, max_chunk_overlap)

# define LLM
llm_predictor = LLMPredictor(
    llm=ChatOpenAI(temperature=temperature, model_name="gpt-3.5-turbo", max_tokens=num_output))
service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor, prompt_helper=prompt_helper)
BeautifulSoupWebReader = download_loader("BeautifulSoupWebReader")
competitor_loader = BeautifulSoupWebReader()
competitor_documents = competitor_loader.load_data(
    urls=['https://url1.com', 'https://url2.com', 'https://url3.com'])
competitor_index = GPTSimpleVectorIndex.from_documents(competitor_documents, service_context=service_context)

YoutubeTranscriptReader = download_loader("YoutubeTranscriptReader")
loader = YoutubeTranscriptReader()
documents = loader.load_data(ytlinks=['https://www.youtube.com/watch?v=xxx',
                                      'https://www.youtube.com/watch?v=xxx',
                                      'https://www.youtube.com/watch?v=xxx'])
index = GPTSimpleVectorIndex.from_documents(documents, service_context=service_context)

combined_competitor_index_and_index = ???
7 comments
m
p
I'm using a following parameters to feed llm with some external factual context and based on that to generate new content.

This context is very long - has something like between 50 00 - 70 00 words. Could anyone explain to me wheather or not I have some advantage when using 16k gpt 3 model over standard gpt 3.5 turbo?

E.g. when generating responses - will they have better quality when using model with larger context window or it does not matter when chunking it using llama? Here are my current specs
1 comment
T