Skip to content

Instantly share code, notes, and snippets.

View Lawrencium77's full-sized avatar

Lawrencium77

  • 16:07 (UTC +01:00)
View GitHub Profile
@Lawrencium77
Lawrencium77 / chatgpt.scpt
Last active September 28, 2023 15:37
Apple Script to open ChatGPT - useful for an Alfred Workflow
-- Establish whether Chrome is already open or not
tell application "System Events"
set isRunning to (name of processes) contains "Google Chrome"
end tell
-- Count the number of open windows. This is useful later on.
tell application "Google Chrome"
set windowCount to count windows
end tell
@Lawrencium77
Lawrencium77 / smoothquant.py
Last active December 29, 2023 09:30
Simple SmoothQuant Implementation
"""
SmoothQuant implementation. See: https://arxiv.org/pdf/2211.10438.pdf
Some details are model-specific, so the code may need tweaking.
"""
import functools
import torch
from torch import nn, Tensor
from typing import Dict, Iterable, Tuple
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")