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 torch | |
import re | |
from einops import rearrange, repeat | |
from functools import lru_cache | |
import copy | |
import numpy as np | |
def isolate_patterns(p): | |
snippets = re.split(r"\[|\]", p) |