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
def align(s1, s2, gap_penalty, match_score = 1, mismatch_penalty = -1): | |
m, n = len(s1), len(s2) | |
H = [[0] * (n + 1) for _ in range(m + 1)] | |
max_score = 0 | |
max_pos = (0, 0) | |
for i in range(1, len(s1) + 1): |
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 numpy as np | |
from tqdm import trange | |
from tinygrad.tensor import Tensor | |
from tinygrad.helpers import CI | |
from tinygrad.engine.jit import TinyJit | |
import random | |
from tinygrad.nn.state import get_parameters | |
from tinygrad.nn.optim import Adam |
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 os | |
import json | |
import time | |
import random | |
import requests | |
from bs4 import BeautifulSoup | |
from urllib.parse import urljoin | |
from colorama import init, Fore, Style | |
import tensorflow as tf | |
from transformers import AutoTokenizer, TFAutoModelForCausalLM |