llm_predictor = LLMPredictor(llm=OpenAI(openai_api_key=st.session_state["OPENAI_API_KEY"], temperature=0,model_name="text-davinci-003")) prompt_helper = PromptHelper(max_input_size=4096, num_output=2000, max_chunk_overlap=0) index = doc_search(question,files,llm_predictor) try: with st.spinner("Working hard to get you a good answer..."): st.markdown(index.query(question, llm_predictor=llm_predictor, prompt_helper=prompt_helper)) except Exception as oops: st.error("GPT Server Error: " + str(oops)+" Please try again.")