by Glenn Matlin / glennmatlin
on all socials
- Download and copy all files in this gist to
~/.claude/
- Move the
.py
files to~/.claude/hooks
- Restart Claude Code.
import javafx.application.Platform; | |
import javafx.embed.swing.JFXPanel; | |
import javafx.scene.Group; | |
import javafx.scene.Scene; | |
import javax.swing.*; | |
/** | |
* A custom {@link java.applet.Applet Applet} that sets-up a JavaFX environment. | |
*/ |
# REQUIRES torchao, torch nightly (or torch 2.5) and transformers | |
from transformers import AutoTokenizer, AutoModelForCausalLM, TorchAoConfig | |
from transformers import TextStreamer | |
import torch | |
from tqdm import tqdm | |
import os | |
os.environ["TOKENIZERS_PARALLELISM"] = "false" # To prevent long warnings :) | |
torch.set_float32_matmul_precision('high') |