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
# modified from https://gist.github.com/dvschultz/3af50c40df002da3b751efab1daddf2c | |
def slerp(t, v0, v1): | |
''' | |
Spherical linear interpolation (batched) | |
Args: | |
t (float/np.ndarray): Float value between 0.0 and 1.0 | |
v0 (np.ndarray): Starting vector | |
v1 (np.ndarray): Final vector | |
Returns: | |
v2 (np.ndarray): Interpolation vector between v0 and v1 |
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 lm_dataformat as lmd | |
from glob import glob | |
import os | |
import json | |
import collections | |
from tqdm import tqdm | |
import re | |
from best_download import download_file | |
import fasttext |