sam-pt icon indicating copy to clipboard operation
sam-pt copied to clipboard

Model creation outside repo directory

Open georgeYanch opened this issue 2 years ago • 1 comments

Hi, I need to create model outside sam-pt directory

For now I get the following error error locating target sam_pt.modelling.sam_pt.SamPt

How do I change _target_ in config in order this to work?

georgeYanch avatar Oct 23 '23 14:10 georgeYanch

Hi @georgeYanch, a dirty workaround would be to add the root directory of SAM-PT to your PYTHONPATH. For example, this can be done by executing export PYTHONPATH="${PYTHONPATH}:/path/to/sam-pt" in your terminal. Replace /path/to/sam-pt with the actual path to your sam-pt root (not to the sam_pt subfolder, but the root of the cloned repo). This should allow Python to locate the sam_pt.modelling.sam_pt.SamPt module when running your script from outside the SAM-PT directory.

A clean solution would be to, for example, make sam-pt a package that can be installed via pip...

m43 avatar Dec 03 '23 22:12 m43