How can I debug streamlit killed crashes?

Running my app locally, 512MB 1 CPU

All I am trying to do is use the basic streamlit chatbot with llamaindex and it keeps getting killed when I run the app. Took the exact code from: Build a chatbot with custom data sources, powered by LlamaIndex

The app loads .md files from a directory and thats the part where I think my app is crashing because when I remove that code, it doesn’t get killed.

Literally using the same code from the starter tutorial and cannot get it to work. There are no code errors or warnings…just “Killed”

@st.cache_resource(show_spinner=False)
def load_data():
with st.spinner(text=“Loading and indexing the Streamlit docs – hang tight! This should take 1-2 minutes.”):
reader = SimpleDirectoryReader(input_dir=“./data”, recursive=True)
docs = reader.load_data()
service_context = ServiceContext.from_defaults(llm=OpenAI(model=“gpt-3.5-turbo”, temperature=0.5, system_prompt=“You are an expert on the Streamlit Python library and your job is to answer technical questions. Assume that all questions are related to the Streamlit Python library. Keep your answers technical and based on facts – do not hallucinate features.”))
index = VectorStoreIndex.from_documents(docs, service_context=service_context)
return index

index = load_data()

Any ideas how I can troubleshoot? I tried restarting as well and no luck.
Cache dir will not populate either…when I run streamlit cache clear …it says empty cache folder.

Any help will be appreciated…have no clue why this always just runs and get killed as soon as I use the app.

Hello and a warm welcome to the Streamlit community! It’s fantastic to see new faces around here. To get started on the right foot, do take a moment to visit our thread Using Streamlit: How to Post a Question Effectively. It’s a treasure trove of insights on crafting posts that are clear and engaging, ensuring you get the best possible advice and solutions from our knowledgeable community members.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.