Find answers from the community

Updated 3 months ago

ServiceContext

Hey for Service context are all these attributes required? 'prompt_helper', 'embed_model', 'node_parser', and 'llama_logger'. I get an error that they are
L
a
9 comments
Try using ServiceContext.from_defaults(..) and only pass in the arguments you want to modify (like llm_predictor, etc)
Like this: defaults = ServiceContext.from_defaults()
service_context = ServiceContext(llm_predictor=llm_predictor,prompt_helper=defaults.prompt_helper, embed_model=defaults.embed_model, llama_logger=defaults.llama_logger, node_parser=defaults.node_parser)
in this context I am just trying to use a custom llm_predictor, also sidenote your advice helped yesterday!(hence now at this point)
Try this

service_context = ServiceContext.from_defaults(llm_predictor=llm_predictor)

This way, everything is set to default settings except for the llm_predictor
(Happy to hear you are making progress! πŸ”₯)
Now I am getting an authentication error RetryError[<Future at 0x12657d330 state=finished raised AuthenticationError>]
Uhhhh lol

What llm are you using? Did you set your openai key correctly?
weird thing where i had to declare the variable openai.api_key
Add a reply
Sign up and join the conversation on Discord