I tried to import “multifit” module as it says in the description here - https://github.com/n-waves/multifit. I want to use pretrained models that were released for 7 languages. But when I tried to import multifit I’ve got an error: ModuleNotFoundError: No module named 'multifit’
Does anybody know how to import this module and use non-English pre-trained models?
Thank you very much for your response.
Yes, I cloned the repository, then installed the dependencies mentioned in “requirements.txt”.
Did I miss something?
@Saioa, sorry for bothering you again, I’ve just realized that the module is imported, but ‘from_pretrained’ function can’t be found. It looks like the module ‘multifit’ is empty. I think it doesn’t ‘see’ my source folder.
Can you tell me please how did you install it?
I work in Google Colab, maybe that is why it has some problems.
I think it is important to follow this order, because it happened to me that if I installed the dependencies first and then multifit, it did not install well. Maybe it’s what’s happening to you.
import fire
import urllib.request
from pathlib import Path
lang_codes = [‘fr’, ‘ja’, ‘en’, ‘de’]
lang_codes = [ ‘de’]
Want to download german books & music train&test.csv from below code, Could you please share command to run this (i mean input args for url_prefix), it will be helpful
def fetch_cls(url_prefix, cls_path=“data/cls”):
“”" Fetch CLS from server using basic auth
url_prefix should point to CLS stored as follow
“https://user:passwd@server/path/[en|fr|de|jp]/[dvd|music|books].[test|train|unlabeled].csv”
data/cls/de-music/models/sp15k
“”"
def fetch(url, CLS):
CLS.parent.mkdir(parents=True, exist_ok=True)
print(“fetching”, url, CLS)
urllib.request.urlretrieve(url, CLS)
for code in lang_codes:
for category in [ ‘music’]:
dir = Path(cls_path)/f’{code}-{category}’
fetch(f"{url_prefix}/{code}/{category}/train.csv", dir / f"{code}.train.csv")
fetch(f"{url_prefix}/{code}/{category}/test.csv", dir / f"{code}.test.csv")
fetch(f"{url_prefix}/{code}/{category}/unlabeled.csv", dir / f"{code}.unsup.csv")