by Glenn Matlin / glennmatlin on all socials
- Download and copy all files in this gist to
~/.claude/ - Move the
.pyfiles to~/.claude/hooks - Restart Claude Code.
| # 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') |
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| # module for http benchmarking using wrk | |
| # example command like | |
| # ./wrk.py --connections '[1,2,3,4]' --filename ./benchmark_qa/query.json --url http://x.y.z.k/hello.php --output 1.csv --duration 600 | |
| import subprocess | |
| import tempfile | |
| import urlparse | |
| from contextlib import contextmanager |
| #include <boost/flyweight.hpp> | |
| #include <boost/multi_index_container.hpp> | |
| #include <boost/multi_index/member.hpp> | |
| #include <string> | |
| #include <cstdint> | |
| #include <vector> | |
| #include <iostream> | |
| #include <tuple> | |
| typedef std::tuple<short, std::uint8_t, std::uint8_t> Date; |
| #include <boost/flyweight.hpp> | |
| #include <boost/multi_index_container.hpp> | |
| #include <boost/multi_index/member.hpp> | |
| #include <string> | |
| #include <cstdint> | |
| #include <vector> | |
| #include <iostream> | |
| #include <tuple> | |
| typedef std::tuple<short, std::uint8_t, std::uint8_t> Date; |
| #include <boost/flyweight.hpp> | |
| #include <boost/multi_index_container.hpp> | |
| #include <boost/multi_index/member.hpp> | |
| #include <string> | |
| #include <cstdint> | |
| #include <vector> | |
| #include <iostream> | |
| #include <tuple> | |
| typedef std::tuple<short, std::uint8_t, std::uint8_t> Date; |
| name: "LNet" | |
| input: "data" | |
| input_dim: 1 | |
| input_dim: 15 | |
| input_dim: 24 | |
| input_dim: 24 | |
| layer { | |
| name: "slicer_data" | |
| type: "Slice" |
| name: "DeepFace_set003_net" | |
| input: "data" | |
| input_dim: 1 | |
| input_dim: 1 | |
| input_dim: 128 | |
| input_dim: 128 | |
| layer{ | |
| name: "conv1" | |
| type: "Convolution" |
| 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. | |
| */ |