Skip to content

Instantly share code, notes, and snippets.

View asehmi's full-sized avatar

Arvindra Sehmi asehmi

View GitHub Profile
@asehmi
asehmi / multithreaded_processing_of_queued_data.py
Created November 27, 2023 19:14
Streamlit multi-threaded task execution, with queues
import time
import random
from queue import Queue
import threading
import streamlit as st
from streamlit.runtime.scriptrunner import add_script_run_ctx
pre_msgs = []
result_msgs = []
post_msgs = []
@asehmi
asehmi / st_fixed_container.py
Created April 1, 2024 16:19 — forked from toolittlecakes/st_fixed_container.py
Sticky/fixed container for streamlit apps. Supports dynamic width change as well as dynamic color updates. Both top/bottom positions are available.
from typing import Literal
import streamlit as st
from streamlit.components.v1 import html
FIXED_CONTAINER_CSS = """
div[data-testid="stVerticalBlockBorderWrapper"]:has(div.fixed-container-{id}):not(:has(div.not-fixed-container)) {{
position: {mode};
width: inherit;
@asehmi
asehmi / stqdm-demo.py
Last active March 25, 2024 18:44
STqdm: A tqdm-like progress bar for Streamlit
# UPDATED: 5-MAY-2023
from multiprocessing import Pool, freeze_support
from time import sleep
import streamlit as st
# https://discuss.streamlit.io/t/stqdm-a-tqdm-like-progress-bar-for-streamlit/10097
# pip install stqdm
from stqdm import stqdm
@asehmi
asehmi / streamlit_debug.py
Last active February 20, 2024 02:31
Handy script I made to help streamline Streamlit debugging
# How to use:
#
# [1] Ensure you have `debugpy` installed:
#
# > pip install debugpy
#
# [2] In your main streamlit app:
#
# import streamlit_debug
# streamlit_debug.set(flag=True, wait_for_client=True, host='localhost', port=8765)
@asehmi
asehmi / df_flexi_query.py
Last active February 13, 2024 16:49
Flexible data filtering UI with declarative query builder [Streamlit, Pandas]
import streamlit as st
import pandas as pd
st.header('Flexible Data Filtering UI')
data = [
{
'name':'name1',
'nickname':'nickname1',
'date':2010,
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asehmi
asehmi / topic-models-v4.ipynb
Created January 23, 2024 07:45 — forked from pszemraj/topic-models-v4.ipynb
Topic Models - v4.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asehmi
asehmi / v-diffusion-art.ipynb
Created January 23, 2024 07:44 — forked from pszemraj/v-diffusion-art.ipynb
v-diffusion-art
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@asehmi
asehmi / semantic-search-inference-ml4hc.ipynb
Created January 23, 2024 07:43 — forked from pszemraj/semantic-search-inference-ml4hc.ipynb
semantic search inference - ml4hc.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.