Skip to content

Instantly share code, notes, and snippets.

View CharlyWargnier's full-sized avatar
🎈

Charly Wargnier CharlyWargnier

🎈
View GitHub Profile
@veekaybee
veekaybee / normcore-llm.md
Last active November 15, 2024 12:06
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@CharlyWargnier
CharlyWargnier / download_csv
Created May 30, 2022 18:31
Streamlit - download_csv via markdown
df = pd.read_csv("reuters-allcats.csv")
csv = df.to_csv(index=False)
b64 = base64.b64encode(csv.encode()).decode()
href = f'<a href="data:file/csv;base64,{b64}" download="myfilename.csv">Try a sample first</a>'
st.markdown("👆 Upload a .csv file. " + href, unsafe_allow_html=True)
st.stop()
@eliasdabbas
eliasdabbas / crawl_multiple_sites.py
Last active April 27, 2022 08:56
Crawl multiple websites with one for loop, while saving the output, logs, and job status separately for each website. Resume crawling any time simply be re-running the same code
from urllib.parse import urlsplit
import advertools as adv
sites = [
'https://www.who.int',
'https://www.nytimes.com',
'https://www.washingtonpost.com',
]
import json
import requests # pip install requests
import streamlit as st # pip install streamlit
from streamlit_lottie import st_lottie # pip install streamlit-lottie
# GitHub: https://github.com/andfanilo/streamlit-lottie
# Lottie Files: https://lottiefiles.com/
def load_lottiefile(filepath: str):
@ksv-muralidhar
ksv-muralidhar / bing_scrape_streamlit.py
Last active August 23, 2021 08:55
bing_streamlit
import pandas as pd
from bs4 import BeautifulSoup
import requests as r
import streamlit as st
st.markdown('<h1 style="background-color: gainsboro; padding-left: 10px; padding-bottom: 20px;">Search Engine Scraper</h1>', unsafe_allow_html=True)
query = st.text_input('', help='Enter the search string and hit Enter/Return')
query = query.replace(" ", "+") #replacing the spaces in query result with +
if query: #Activates the code below on hitting Enter/Return in the search textbox
@mtanco
mtanco / wave_use_uploaded_data.py
Last active February 26, 2021 04:15
wave_use_uploaded_data
import os
import time
from h2o_wave import main, app, Q, ui, data
import pandas as pd
import numpy as np
@app('/')
async def serve(q: Q):
print(q.args)
@mtanco
mtanco / wave_plot_from_pandas.py
Created December 20, 2020 18:31
Example of how to format a pandas dataframe for plotting with native Wave plot functions
# Plot / Dataframe
# Examples of how to format pandas data when plotting
# Use the `tolist()` function on `df.columns` and `df.values` along with Wave's `data` class
# ---
from h2o_wave import site, data, ui, main
import pandas as pd
import numpy as np
# Page to hold our charts
page = site['/demo']
import streamlit as st
from ludwig.api import LudwigModel
import pandas as pd
st.cache(show_spinner=False)
def load_model():
#Update with the path to the Ludwig trained model
model = LudwigModel.load("results/experiment_run_1/model/")
return model
@andfanilo
andfanilo / les-miserables.json
Last active December 9, 2020 00:13
Force Layout example in Streamlit
{
"nodes": [
{
"id": "0",
"name": "Myriel",
"itemStyle": null,
"symbolSize": 10,
"x": null,
"y": null,
"attributes": {
from urllib.parse import urlparse
import re
url="https://www.amazon.com/SanDisk-128GB-microSDXC-Memory-Adapter/dp/B073JYC4XM/"
print(set(re.split("[/-]", urlparse(url).path)))
#output
#{'', 'B073JYC4XM', 'dp', '128GB', 'microSDXC', 'Memory', 'SanDisk', 'Adapter'}