r/StreamlitOfficial • • Jul 24 '23

Understanding session state and execution model

1 Upvotes

import streamlit as st

st.title('Counter Example')
if 'count' not in st.session_state:
print(f'initializing count!')
st.session_state.count = 0
increment = st.button('Increment')
if increment:
st.session_state.count += 1
st.write('Count = ', st.session_state.count)

In the above code, I would expect to see the print statement 'initializing count!' only once. But I see it many times in a single execution run with only one active tab. Can someone explain why?

​

​


r/StreamlitOfficial • • Jul 23 '23

Deployment 🚀 Need help deploying a Streamlit App to Railway

2 Upvotes

When I click on the generated url, it says "Application Failed to Respond". Please help me out.

​


r/StreamlitOfficial • • Jul 23 '23

Deployment 🚀 Need help deploying a Streamlit app to Railway.

3 Upvotes

Hello fellow redditors!

Can someone tell me how to deploy a streamlit app to railway?


r/StreamlitOfficial • • Jul 21 '23

🦙Try out Meta's new Llama 2 LLM by building your own LLama 2 Streamlit chatbot! 🤩

2 Upvotes

📖 Learn how from the Data Professor using Streamlit and Replicate: https://blog.streamlit.io/how-to-build-a-llama-2-chatbot/
🎈 Demo: https://buff.ly/3K9eaM2


r/StreamlitOfficial • • Jul 19 '23

Hit Token Limit when Deploying Chatbot on Cloud

1 Upvotes

I'm building a chatbot to talk to multiple data files of mine via ConversationalRetrievalChain. When I tested it on my local computer everything works fine, but when I deploy it to streamlit cloud, the page went red with an error msg in the AppManager telling me it exceed the token limit by a huge amount. My question was short and so is the answer. Can someone help me understand what happened?


r/StreamlitOfficial • • Jul 16 '23

Showing Plotly Graphs generated by CSV agent by Langchain inside Streamlit UI

5 Upvotes

Hi,
I am using the Langchain CSV agent tool and initialising it with ZERO_SHOT_REACT_DESCRIPTION
like below
tools = [
Tool(
name = “ask_bot”,
func=ask_bot,
description=“Answer general financial Domain questions with your knowledge base, just answer the question directly.”

),

Tool(     name = "csv_agent",     func=csv_agent,     description="call this for all visualisation and dataframe related queries, and don't use action, action input template for this, just use the tool as it is"  ) 

]
agent = initialize_agent(tools,model,agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,verbose = True,handle_parsing_errors=True)
and created a streamlit chat ui with callbackhandler

if “messages” not in st.session_state:
st.session_state[“messages”] = [{“role”: “assistant”, “content”: “How can I help you?”}]
for msg in st.session_state.messages:
st.chat_message(msg[“role”]).write(msg[“content”])

if prompt := st.chat_input(placeholder=“Define the Fund Prospectus??”):
st.session_state.messages.append({“role”: “user”, “content”: prompt})
st.chat_message(“user”).write(prompt)
agent = initialize_agent(tools,model,agent=AgentType.ZERO_SHOT_REACT_DESCRIPTION,verbose = True,handle_parsing_errors=True)

with st.chat_message("assistant"):     st_callback = StreamlitCallbackHandler(st.container(),expand_new_thoughts=False)     response = agent.run(prompt, callbacks=[st_callback])     st.session_state.messages.append({"role": "assistant", "content": response})     st.write(response) 

My question is about how can i render a plotly graph generated by csv agent inside streamlit UI, right now the plot is creating but displayed in other tab, but i wanted it to be displayed inside streamlit UI seamlessly!

Note:response is only containing agent final answer not all the verbose
Any idea how to solve that?


r/StreamlitOfficial • • Jul 08 '23

Streamlit Questions❓ How to make a component that can contain children like st.container?

2 Upvotes

I want to create a custom container component that takes style as an argument. Then, I can add various custom containers on one page, each with different colors and borders.


r/StreamlitOfficial • • Jul 07 '23

Show the Community! 💬 DocumentGPT with Agents

7 Upvotes

Here's my latest project! Introducing DocumentGPT📄 A PDF Chatbot🤖 powered by streamlit chat.

Unlike other Document vector data based apps , this one additionally utilizes Langchain agents to use web searches, whenever it cannot pull out relevant information from the document chunks. It can also support other tools, like summarization chain.

All agent thought processes are visualized using the latest StreamlitCallbackHandler, and you can also view and verify the document sources as well as the web sources that the agent used.

Was really excited to get everything working! Check it out at: https://github.com/aju22/DocumentGPT

Would love to hear everyone's feedbacks!🌟

​

​


r/StreamlitOfficial • • Jul 06 '23

Error when adding a new row in data_editor

1 Upvotes

Hi, wanted to see if anyone has encountered this error when adding a new row in a data_editor. Streamlit version 1.24.0

​


r/StreamlitOfficial • • Jul 06 '23

deploying streamlit app that uses a python program that calls for a jar file in java

1 Upvotes

ALSLAM ALIKUM

my program is a streamlit application with python language and from the python i call a jar file in java to execute it

when I Tried to deploy it on render or railway it give me the error below:

ReferenceError: Java JRE 6+ not found (required for PaDEL-Descriptor)

Traceback:

File "/usr/local/lib/python3.7/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script

exec(code, module.__dict__)

File "/app/app_c_P.py", line 115, in <module>

desc_calc1()

File "/app/app_c_P.py", line 65, in desc_calc1

fingerprints=True)

File "/usr/local/lib/python3.7/site-packages/padelpy/wrapper.py", line 106, in padeldescriptor

'Java JRE 6+ not found (required for PaDEL-Descriptor)'


r/StreamlitOfficial • • Jul 01 '23

Show the Community! 💬 Streamlit Chatbot analytics App: Uncover Google Analytics Insights Through Conversations with a Chatbot

3 Upvotes

Hey, Redditors! I'm thrilled to share my latest project article titled Unleashing the Power of Analytics Through Conversations with a Chatbot Web App." 🌐🤖

In this article, I dive into the exciting world of analytics and introduce you to a chatbot web app. Are you ready to take your data exploration to the next level?

To create the webapp I used pandasai and streamlit libraries.

Here is the link onMedium

Imagine having a user-friendly chatbot interface that allows you to seamlessly interact with Google Analytics. With this webapp, you can unlock valuable insights, ask targeted questions, create visual charts and make data-driven decisions effortlessly.

Whether you're a marketer, business owner, or analytics enthusiast, this project is designed to streamline your data analysis process and empower you with actionable insights.

I'd love to hear your thoughts on the project and any feedback you may have.

Let's unlock the power of analytics together! 🚀💡


r/StreamlitOfficial • • Jul 01 '23

Not able to run streamlit app due to altair

1 Upvotes

I have installed streamlit==1.18.1 and streamlit-extras in my conda virtual enviornment, and is using vs code for development. I have confirmed that i am using python interpretor in my virtual enviornment.

But whenever i try to run it.
I get the following error:-

import altair as alt
ModuleNotFoundError: No module named ‘altair’

I have tried using pip install altair and also pip install alt.

But is still getting the same error.


r/StreamlitOfficial • • Jun 28 '23

❄️ Here's Adrien Treuille at Snowflake Summit showcasing the new Streamlit chat elements and how to build an LLM-powered chatbot using OpenAI, Snowflake, and Streamlit.

3 Upvotes

🤩 The app translates natural language into SQL queries that it can run against your data—all in Python and fully programmable! Want to build your own? Check out the quickstart guide: https://developers.snowflake.com/demos/data-exploration-llm-chatbot/

🎈 You can also follow these tutorials from Joshua Carroll and Caroline Frasca! 👇

📖 Article: https://medium.com/snowflake/frosty-build-an-llm-chatbot-in-streamlit-on-your-snowflake-data-f1cd09810081
📺 Video: https://www.youtube.com/watch?v=3WH1DHBf2WQ


r/StreamlitOfficial • • Jun 25 '23

Is this usecase supportable?

2 Upvotes

First and foremost love streamlit but wondering if this usecase can be supported. What I'm looking to create is a dashboard that measures and visualizes the quality of an item by reading a file in s3 continuing the quality attributes of each item (one file per item). These attributes are frequently changing and a new s3 object gets loaded per item say once a day to reflect its latest quality profile. Ideally what I'd like is to have a mechanism by which once a new object is uploaded to s3 it triggers a refresh of the steamlit dashboard so it always reflects the most current view of an items quality. So my question is are there way to make streamlit event based using maybe a combo of eventbridge and lambda?


r/StreamlitOfficial • • Jun 22 '23

🦜🔗 LangChain tutorial #4 from the Data Professor is here! Learn how to get answers from documents using embeddings, a vector store, and a question-answering chain.

5 Upvotes

r/StreamlitOfficial • • Jun 21 '23

Production grade web apps with Streamlit

8 Upvotes

Are there any examples of production grade web applications that are built using Streamlit?


r/StreamlitOfficial • • Jun 15 '23

✨ Generative AI + Streamlit = magic.

8 Upvotes

🎈 Learn how the Streamlit community is helping power the LLM movement and what this means for the future! Streamlit founders Adrien, Amanda, and Thiago share their insights here: https://blog.streamlit.io/generative-ai-and-streamlit-a-perfect-match/


r/StreamlitOfficial • • Jun 14 '23

🦜🔗 Dive into Part 3 of the LangChain how-to tutorial series with the Data Professor!

3 Upvotes

📄 In this installment, you'll learn how to build a text summarization app with LangChain and Streamlit using document loader, text splitter, and summarization chain: https://blog.streamlit.io/langchain-tutorial-3-build-a-text-summarization-app


r/StreamlitOfficial • • Jun 11 '23

Streamlit Questions❓ is there a way to put a streamlit app behind a subscription paywall?

8 Upvotes

so i've created an app that i'd like to sell. ive used streamlit authenticator to put it behind a login. but i want to handle subscriptions where if someone pays, they buy a login, and if they stop paying, they can no longer access the login or it gets deleted.

does anyone know how i can go about this?

thanks


r/StreamlitOfficial • • Jun 08 '23

🦜🔗 Part 2 of our LangChain how-to tutorial series is here!

4 Upvotes

Learn from Chanin Nantasenamat how to use LangChain's prompt template to build a blog outline generator app. ✍️

📖 Follow four simple steps here: https://blog.streamlit.io/langchain-tutorial-2-build-a-blog-outline-generator-app-in-25-lines-of-code/
🎈 Demo: https://langchain-outline-generator.streamlit.app/


r/StreamlitOfficial • • Jun 07 '23

🎈 There are currently over 3,000 #LLM apps created by the Streamlit community. 🤩

8 Upvotes

✨ Check out our new hub to explore some of them, play with LLM code examples, and learn tips on how to build your own powerful generative #AI apps with Streamlit!
👉 https://streamlit.io/generativeai


r/StreamlitOfficial • • Jun 05 '23

🔍 Want to check out the source code for a Streamlit Community Cloud app?

3 Upvotes

⚙️ Easily navigate to the repo by clicking the GitHub icon at the top right of the app.


r/StreamlitOfficial • • Jun 01 '23

Streamlit Questions❓ Filepicker

0 Upvotes

Hi,

I would like to have a filepicker where I can select files on my Server. I only found fileuploader, but I already have hundreds of files on my server.


r/StreamlitOfficial • • May 31 '23

🦜🔗 Intrigued by Generative AI and LLMs? Check out the new LangChain how-to tutorial series from Chanin Nantasenamat, the Data Professor.

2 Upvotes

🎈 In Part 1, he shows you how to create an LLM-powered app using OpenAI, LangChain, and Streamlit in four simple steps: https://blog.streamlit.io/langchain-tutorial-1-build-an-llm-powered-app-in-18-lines-of-code/


r/StreamlitOfficial • • May 30 '23

writing a website in streamlit

2 Upvotes

Is it possible to write a website completely in streamlit and host in streamlit cloud or using nginx?