This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env -S uv run --script | |
| # /// script | |
| # requires-python = ">=3.11" | |
| # dependencies = ["typer>=0.12"] | |
| # /// | |
| # | |
| # membounce — bounce this project's Claude Code memories to/from a secret gist. | |
| # ============================================================================ | |
| # | |
| # Claude Code keeps per-project "memories" as flat markdown files under |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /// script | |
| # requires-python = ">=3.11" | |
| # dependencies = [ | |
| # "rich", | |
| # "torch", | |
| # "transformers", | |
| # "typer", | |
| # ] | |
| # /// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import argparse | |
| from collections import Counter | |
| import os | |
| from struct import unpack | |
| from dataclasses import dataclass | |
| @dataclass | |
| class Mp3Frame: | |
| data: bytes | |
| bitrate: int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #[cfg(all(target_arch = "x86_64", target_feature = "avx2"))] | |
| unsafe fn hammcmp_256bit_avx2(mut a: &[u8], mut b: &[u8]) -> u32 { | |
| use std::arch::x86_64::{*}; | |
| let mut dist = 0; | |
| while a.len() >= 32 { | |
| let av = _mm256_loadu_si256(a.as_ptr() as *const _); | |
| let bv = _mm256_loadu_si256(b.as_ptr() as *const _); | |
| let axorb = _mm256_xor_si256(av, bv); | |
| dist += _popcnt64(_mm256_extract_epi64(axorb, 0)); | |
| dist += _popcnt64(_mm256_extract_epi64(axorb, 1)); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ (for C in 1.0 2.0 2.5 3.0 3.5 4.0; do echo "/cfg $C"; echo "/reset"; echo "How do I become famous?"; done) | ./target/release/chat --mirostat --cfg-scale 2.0 --system-prompt "act as an expert chef" | |
| Using ChatML prompting format. | |
| mpt_model_load: loading model from 'minmpt.cpp/models/ggml-mpt-7b-chat-q5_1.bin' - please wait ... | |
| mpt_model_load: ggml ctx size = 5397.09 MB | |
| mpt_model_load: ........................ done | |
| mpt_model_load: model size = 5397.02 MB / num tensors = 194 | |
| mpt_kvcache: memory_size = 1024.00 MB, n_mem = 65536 | |
| CFG Mode on! | |
| mpt_kvcache: memory_size = 1024.00 MB, n_mem = 65536 | |
| cfg_scale=1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // make mcs; ./mcs file | |
| // writes <sample size> as uint32 to mincore.bin followed by 1 mincore() per second for 60 seconds | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| #include <errno.h> | |
| #include <sys/types.h> | |
| #include <sys/mman.h> | |
| #include <sys/stat.h> | |
| #include <stdint.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <sys/mman.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| size_t memtotal() { | |
| char buf[200]; | |
| size_t ret; | |
| FILE* meminfo = fopen("/proc/meminfo", "r"); | |
| if (!meminfo) { |
NewerOlder