Hey!
I am very new to the use of streamlit, and a developer gave me the code of an old st-radial component, but when using it, it gives me the following error, does anyone know what could be causing it?
Hey!
I am very new to the use of streamlit, and a developer gave me the code of an old st-radial component, but when using it, it gives me the following error, does anyone know what could be causing it?
What version of Streamlit are you running?
Im using 1.17.0
I am experiencing a similar problem with version 1.18.0.
The problem shows up only when client is passing through a web proxy to the streamlit server. The script runs well without the proxy.
Any idea of the available workaround?
Same issue here (for a different component though). Running on 1.18.1 - seems like the component instance can’t access the front ends dist files
This issue is solved by tunning the web proxy. It did not allow component traffic. Allowing the component path, all run well.
Any pointers on how to do that?
This is a bit complicate, I got the help from my network manager tunning the proxy server, which I do not know how to elaborate.
Thank you for pointing out the issue with proxy server. I would really appreciate if you could name the appropiate options/settings for tunning the proxy.
@Herbert_Yu Please help share some tricks.
I have the same issues with my streamlit apps. They work great in my local computer, but will show the weird erros in cloud when I am using company proxies to visit the webiste. Now I have to remove all Streamlit component.
In my case, the problem was apparently caused by a set X-Frame-Options header that prevented the component from reloading. A colleague of mine was able to fix the problem by using the appropriate proxy or other network settings.
To my best understanding,
if you are working with a proxy server exposing the streamlit service and using autorefresh module, beware the default streamlit web socket redirection is ws://…/_stcore/stream which may be the same as the autorefresh component http://…/component/streamlit_autorefresh.st_autorefresh/index.html?streamlitUrl… For proper operation, you need proper separation between the two with web proxy mapping.
I hope this helps.
Herbert
jinbo_st via Streamlit <notifications@streamlit.discoursemail.com> 於 2023年4月9日 週日 下午9:20寫道:
@Herbert_Yu
Hi, I have exactly the same problem. Could you give addtional info about tuning proxy server?
Hi Alex,
I got help from network manager. He sorted out the service urls and map them to the the public service with a proxy in between. He understand well the architecture in our environment, so it would not be difficult to him. The service went well and still now in service. This is what I know best.
Herbert
Alex Yakubovich via Streamlit <notifications@streamlit.discoursemail.com> 於 2023年7月5日 週三 下午4:49寫道:
The easiest way to solve this issue is to increase the timeout.
Search ",3e3" in the main JS file.
change to ',3e4'
Here’s a modified version of your code that uses the st.write
function to display the chat messages, it solved it for me.
‘’’
import openai
import os
from dotenv import load_dotenv
import streamlit as st
# Load environment variables
load_dotenv()
# Setting page title and header
st.set_page_config(page_title="AVA", page_icon=":robot_face:")
st.markdown("<h1 style='text-align: center;'>AVA - a totally harmless chatbot 😬</h1>", unsafe_allow_html=True)
# Other code remains the same
# Replace this block
# if st.session_state['generated']:
# with response_container:
# for i in range(len(st.session_state['generated'])):
# message(st.session_state["past"][i], is_user=True, key=str(i) + '_user')
# message(st.session_state["generated"][i], key=str(i))
# st.write(
# f"Model used: {st.session_state['model_name'][i]}; Number of tokens: {st.session_state['total_tokens'][i]}; Cost: ${st.session_state['cost'][i]:.5f}")
# counter_placeholder.write(f"Total cost of this conversation: ${st.session_state['total_cost']:.5f}")
# Replace with this block
if st.session_state['generated']:
for i in range(len(st.session_state['generated'])):
st.write(f"You: {st.session_state['past'][i]}")
st.write(f"AVA: {st.session_state['generated'][i]}")
st.write(f"Model used: {st.session_state['model_name'][i]}; Number of tokens: {st.session_state['total_tokens'][i]}; Cost: ${st.session_state['cost'][i]:.5f}")
counter_placeholder.write(f"Total cost of this conversation: ${st.session_state['total_cost']:.5f}")
’
Hey thanks, it worked but how do i add custom avatar for user and bot ?
Does that change the timeout to 4seconds?
where JS file
How was this resolved ?
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.