h1. ~ h6. 分别对应一级至六级标题。
- 粗体:
*文字* - 斜体:
_文字_ - 引用:
??文字?? - 删除线:
-文字-
| #!/usr/bin/env fish | |
| function check_var -a var msg | |
| if test -z $var; echo $msg >&2; exit 1; end | |
| end | |
| function check_status -a msg | |
| if test $status != 0; echo $msg >&2; exit 1; end | |
| end |
| (async () => { | |
| const Main = await import('resource:///org/gnome/shell/ui/main.js'); | |
| const { default: GLib } = await import('gi://GLib'); | |
| const ind = Main.panel.statusArea.keyboard; | |
| const mgr = ind?._inputSourceManager; | |
| if (!mgr) return; | |
| const update = () => { | |
| const text = ind._indicatorLabels[mgr.currentSource?.index]?.get_text(); |
| /* gcc -O2 -march=native -o kgp kgp.c -lm */ | |
| #define _POSIX_C_SOURCE 200809L | |
| #include <math.h> | |
| #include <signal.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <time.h> |
| # pip install torch huggingface_hub safetensors tokenizers transformers | |
| import sys, re, time | |
| from pathlib import Path | |
| from collections import defaultdict | |
| import torch | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| from tokenizers import Tokenizer | |
| from safetensors import safe_open |
| #include <poll.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <termios.h> | |
| #include <unistd.h> | |
| struct termios orig_termios; | |
| void reset_terminal() { |
| from struct import pack, unpack_from | |
| class MKFDecoder(object): | |
| def __init__(self, path=None): | |
| assert path or data | |
| with open(path, "rb") as f: | |
| self._content = memoryview(f.read()) | |
| self.count = unpack_from("<I", self._content, 0)[0] // 4 | |
| self.indexes = tuple( |
| from pathlib import Path | |
| import torch | |
| import torch.nn as nn | |
| import torch.nn.functional as F | |
| from safetensors import safe_open | |
| from tokenizers import Tokenizer | |
| CFG = { | |
| "vocab_size": 262_144, | |
| "context_length": 32_768, |
| from dataclasses import dataclass | |
| from pathlib import Path | |
| import torch | |
| from torch import nn | |
| import torch.nn.functional as F | |
| from safetensors import safe_open | |
| from tokenizers import Tokenizer |
| import os | |
| from functools import lru_cache | |
| import torch | |
| from torch import nn | |
| import torch.nn.functional as F | |
| from transformers import Qwen3Config | |
| from transformers import Qwen2TokenizerFast |