Skip to content

Instantly share code, notes, and snippets.

View leogao2's full-sized avatar

Leo Gao leogao2

View GitHub Profile
# 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
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