Skip to content

Instantly share code, notes, and snippets.

@veekaybee
veekaybee / normcore-llm.md
Last active June 26, 2024 16:41
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

@svpino
svpino / instructions.md
Last active September 12, 2023 03:39
Installing TensorFlow on Apple Silicon
@maslychm
maslychm / pytorch_m1_gpu.MD
Created May 18, 2022 20:58
Install Mac M1 PyTorch GPU support

Install PyTorch 1.12.0 with Mac M1 GPU support (MPS device: for Metal Performance Shaders)

TLDR: Dowload package directly from anaconda.org and install over the current torch version

Explanation

Wrong version (1.10.2) gets installed for me when I run conda install pytorch -c pytorch-nightly.
To fix, install the latest pytorch version from the stable channel, then manually download package for your python version, and install it over the current pytorch. Newest Pytorch Nightly releases here: Anaconda: Pytorch Nightly Files.

@ortegatron
ortegatron / LossEvalHook.py
Last active March 14, 2024 19:10
Trainer with Loss on Validation for Detectron2
from detectron2.engine.hooks import HookBase
from detectron2.evaluation import inference_context
from detectron2.utils.logger import log_every_n_seconds
from detectron2.data import DatasetMapper, build_detection_test_loader
import detectron2.utils.comm as comm
import torch
import time
import datetime
class LossEvalHook(HookBase):
@ylashin
ylashin / web_api.py
Last active March 7, 2024 04:53
Detectron2 Flask Web API
import flask
from flask_cors import CORS
from flask import request, jsonify
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from detectron2.data import MetadataCatalog
import cv2
import requests
import numpy as np
@swedishmike
swedishmike / gist:902fb27d627313c31a95e31c44e302ac
Created October 17, 2019 13:07
Adding and removing virtual environments to Jupyter notebook
## Create the virtual environment
conda create -n 'environment_name'
## Activate the virtual environment
conda activate 'environment_name'
## Make sure that ipykernel is installed
pip install --user ipykernel
## Add the new virtual environment to Jupyter
@MuhsinFatih
MuhsinFatih / fix-macos-python.md
Last active June 26, 2024 05:52
How to recover from messed up python installation on mac, and never have to mess with apple's shitty python confusion factory

I am assuming you are here because like me, you installed a bazillion different python interpreters on mac and the whole thing is a spagetti. Today, I finally fixed my python installation. Whatever I install for python2 or python3 using pip JUST.WORKS.. My god! finally.

What the hell?

Here is what I had messed up, which you also probably did:

  • I had too many different python interpreters
  • Too many different symlinks which I lost track of
  • almost no package I installed with pip worked without a headache
  • any attempt to fix using online resources made it worse.
@mschae16
mschae16 / prepworkshop.md
Last active August 15, 2018 18:12
Prerequisites for Docker and Kubernetes 101 Workshops

To prepare for the Docker 101 workshop, please install Docker and follow the steps in creating a Dockerhub account.

To prepare for the Kubernetes 101 workshop, please install the following:

Verify your minikube install by running the following commands in your terminal:

$ minikube start and

@everling-prime
everling-prime / nerdy.ipynb
Created September 29, 2017 07:51
Nerdy Notebook (Machine Learning with NPAS)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SSARCandy
SSARCandy / gpu-occupy-status.sh
Last active August 26, 2021 17:18
Show GPU occupying status in dgx-1 (using nvidia-smi)
#!/bin/bash
function show_gpu_user {
pid=$(pstree -sg $1 | grep -Eo 'bash\([0-9]*\)' | head -1 | grep -Eo '[0-9]*');
docker ps -q | xargs docker inspect --format "{{.Name}} {{.State.Pid}}" | grep $pid | awk '{printf "%-24s", $1}';
ps aux | grep $1 | grep -v grep | awk '{ for(i=1;i<=NF;i++) {if ( i >= 11 ) printf $i" "}; printf "\n" }';
}
echo " ";