Hey Robert,
So sorry about the long delay, I haven’t been around on the forum as much as I would like as we have a lot of exciting things in the works!
No worries we have all been there thanks for clearing this up and adding your code snippets!
So there is no Streamlit API for this, but community members make components (which are plug-ins) for Streamlit! You may find something out of the box there that may work for you, or you might be able to adapt something someone else made! I’m thinking of the Disqus and Discord components that @okld made!
here is a link to our components: App Gallery • Streamlit
Also, recently there was this fantastic app made by @jrieke (Creator turned team member ) where he linked twitter into his Year on Github app! I took the liberty (hope that’s ok @jrieke ) to grab his GitHub repo for you, I think you will have some success with this example of linking twitter into Streamlit! GitHub - jrieke/year-on-github: 🐙 Share your Github stats for 2020 on Twitter
I would say yes, depending on the size of it you could load it in before or after. But you may want to actually make a small function for it, that way you can add the @st.cache
decorator to your function call in your Streamlit app, and (I’m assuming) because your .rar file won’t change, this will only have to load one time and then help speed up the app for users!
I am less sure about this one. Based on the notebook link you sent me it seems your trying to translate a Jupyter Notebook into a Streamlit App? Jupyter notebook usually lets you run pip install commands directly from the notebook cells, but Streamlit acts just like any python package. You would need to install this in your environment before you try running your script. (assuming I have understood this issue correctly!)
Here are the steps I would recommend:
- make a clean environment (pip or conda) for a specific python version
- In that new environment, pip or conda install the packages you want to use, streamlit, gpt-2-simple, tensorflow (?) and any others
- in your
streamlit_app.py
script, remove the %tensorflow_version 1.x
and
!pip install -q gpt-2-simple
, and just import these packages like your third line in your app there (import gpt_2_simple as gpt2
)
Let’s see where this gets us!
Also, have you put your app in a GitHub repo? If you can do that and share it, that would be super helpful!
Hope this helps!
Happy Streamlit-ing!
Marisa