indicTrans icon indicating copy to clipboard operation
indicTrans copied to clipboard

Model only works inside the indicTrans folder.

Open Gaurav0502 opened this issue 2 years ago • 0 comments

Hi, I did the setup as explained in python inference demo colab notebook. It happened properly. However, the model only works inside the indicTrans folder. Accessing it from anywhere outside results in ModuleNotFoundErrors or FileNotFoundErrors.

ModuleNotFoundError: No module named 'indicTrans'

I had a FastAPI backend where I needed to access the model outside indicTrans but its not working. The code I tried is given below:

import sys
sys.path.append(path_to_indictrans_folder)
from indicTrans.inference.engine import Model

indic2en_model = Model(expdir='../indic-en')

[Same code without sys.path.append works inside indicTrans]

Is there any mistake in accessing the model using this code or is there any other approach?

OS Used: Linux Mint

Gaurav0502 avatar Nov 01 '23 11:11 Gaurav0502