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 fasttext | |
import fasttext.util | |
from argparse import ArgumentParser | |
# fasttext v0.9.2 | |
# https://github.com/AlexKay28 | |
def main(model_path, to_size, new_model_path): | |
""" | |
Reduce vectors size in fasttext model |
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 | |
def getInOut(orig_fun=None, path_in=None, path_out=None): | |
def _decorate(fun): | |
@functools.wraps(fun) | |
def wrapper(*args, **kwargs): | |
os.chdir(path_in) | |
fun(*args, **kwargs) | |
os.chdir(path_out) |