- grammar_hack.py is completely new;
- all the other files are minimally modified, with additions marked by
#####
. - Bring your own
grammar.ebnf
. - The LRU cache is very sketchy, but prevented having to plumb through a correct lifetime.
- Not sure what happens if it gets backed into a corner where there's no valid next state for the state machine.
This file contains 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 python | |
import sys | |
import fire | |
from itertools import cycle | |
from transformers import AutoTokenizer | |
def cycle_colors(tokenizer_name): | |
text = sys.stdin.read() | |
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name) |
This file contains 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 python | |
import sys | |
import fire | |
from itertools import cycle | |
from transformers import AutoTokenizer | |
def cycle_colors(tokenizer_name): | |
text = sys.stdin.read() | |
tokenizer = AutoTokenizer.from_pretrained(tokenizer_name) |
This file contains 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
#!ruby --disable-gems | |
require 'open3' | |
def find_git_root(curr = Dir.pwd) | |
abort('no git repository') if curr == '/' | |
return(curr) if File.exist?(File.join(curr, '.git')) | |
find_git_root(File.expand_path('..', curr)) | |
end |
This file contains 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
OBJS := lol.o b64.o | |
lol: $(OBJS) | |
cc -o $@ $(OBJS) | |
%.o: %.c | |
cc -c $< -o $@ |
This file contains 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 sys | |
import os | |
# Add the _vendor directory to the Python path | |
vendor_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '_vendor') | |
sys.path.insert(0, vendor_dir) | |
# Now you can import the bundled library | |
import openai |
This file contains 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
exprs = File.readlines('input') | |
.map { |l| " (seq.unit \"#{l.chomp}\")" } | |
.join("\n") | |
smt2 = File.read('tpl.smt2') | |
.sub('%EXPRS%', exprs) | |
File.write('out.smt2', smt2) | |
This file contains 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
(set-logic QF_ALIA) | |
(declare-const len Int) | |
(assert (= len 247)) | |
(declare-const a (Array Int Int)) | |
(define-fun x () (Array Int Int) | |
(store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store (store |
This file contains 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
(set-logic AUFLIA) | |
(declare-sort RPS 0) | |
(declare-fun rock () RPS) | |
(declare-fun paper () RPS) | |
(declare-fun scissors () RPS) | |
(declare-sort OUTCOME 0) | |
(declare-fun win () OUTCOME) | |
(declare-fun lose () OUTCOME) |
This file contains 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
// -*- mode: c++ -*- | |
#include "Kaleidoscope.h" | |
#include "Kaleidoscope-Macros.h" | |
#include "Kaleidoscope-LEDControl.h" | |
#include "Kaleidoscope-LEDEffect-BootGreeting.h" | |
#include "Kaleidoscope-LED-Stalker.h" | |
#include "Kaleidoscope-SpaceCadet.h" | |
// Macros |
NewerOlder