Skip to content

Instantly share code, notes, and snippets.

View sbarman-mi9's full-sized avatar
🌎
🤔

Snehasish Barman sbarman-mi9

🌎
🤔
View GitHub Profile
@sbarman-mi9
sbarman-mi9 / gist:d1be116e98fded14b0de9acd68c70d3c
Last active February 22, 2024 06:29
GenAI in Enterprise
🔖 OpenAI Stuff
📰 Practices for Governing Agentic AI Systems
https://cdn.openai.com/papers/practices-for-governing-agentic-ai-systems.pdf
📰 Weak-to-strong generalization
https://cdn.openai.com/papers/weak-to-strong-generalization.pdf
📰 Building an early warning system for LLM-aided biological threat creation
https://openai.com/research/building-an-early-warning-system-for-llm-aided-biological-threat-creation
🔖 Responsible AI
🔯 https://sites.google.com/view/responsible-gen-ai-tutorial
import warnings
from IPython.display import display, HTML, Markdown
warnings.filterwarnings("ignore")
if 'pandas' in sys.modules:
pd.set_option('display.max_columns', 500)
pd.set_option('display.max_rows', 200)
pd.set_option("display.max_colwidth", None)
pd.set_option('display.float_format', lambda x: '%.3f' % x)
pd.set_option('io.hdf.default_format','fixed') # store binary data in HDF5 'table' format or 'fixed' format
sudo apt install unzip
sudo apt update
sudo apt install python3-pip -y
sudo apt-get install python3-venv -y
sudo apt-get install build-dep python-psycopg2 -y
sudo apt-get install build-dep python3-psycopg2 -y
# create virtual environment
python3 -m venv envr
source envr/bin/activate
@sbarman-mi9
sbarman-mi9 / setup.sh
Last active August 25, 2019 08:21
A script for common installation packages
#!/bin/bash
# Link:
# https://gist.githubusercontent.com/sbarman-mi9/62107991d637000aba220f720514d71c/raw/2c74ab6f54318b5b30d8945a8ee7148ae293ae68/setup.sh
# Command:
# !curl -s https://gist.githubusercontent.com/sbarman-mi9/62107991d637000aba220f720514d71c/raw/2c74ab6f54318b5b30d8945a8ee7148ae293ae68/setup.sh | bash
echo Updating/Installing packages...
pip install -U --no-cache-dir tensorflow-gpu==2.0.0-rc0
@sbarman-mi9
sbarman-mi9 / contractions.py
Created July 8, 2019 03:03 — forked from nealrs/contractions.py
Expand common (and some very uncommon) english contractions
"""
this code is not mine! i shamelessly copied it from http://stackoverflow.com/questions/19790188/expanding-english-language-contractions-in-python
all credits go to alko and arturomp @ stack overflow.
basically, it's a big find/replace.
"""
import re
cList = {
"ain't": "am not",
@sbarman-mi9
sbarman-mi9 / install_anaconda.md
Created April 16, 2019 11:42 — forked from kauffmanes/install_anaconda.md
Install Anaconda on Windows Subsystem for Linux (WSL)

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_65.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose Anaconda3-5.2.0-Linux-x86_64.sh.
  4. From the terminal run wget https://repo.continuum.io/archive/[YOUR VERSION]. Example: $ wget https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
  5. Run the installation script: $ bash Anaconda[YOUR VERSION].sh ($ bash Anaconda3-5.2.0-Linux-x86_64.sh)
  6. Read the license
@sbarman-mi9
sbarman-mi9 / postgres-cheatsheet.md
Created October 26, 2018 21:04 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@sbarman-mi9
sbarman-mi9 / README.md
Created October 12, 2018 05:56 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation