We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4345ef9 commit 16cefacCopy full SHA for 16cefac
torchx/specs/finder.py
@@ -7,6 +7,7 @@
7
# pyre-strict
8
9
import abc
10
+import copy
11
import importlib
12
import inspect
13
import logging
@@ -281,7 +282,9 @@ def find(
281
282
)
283
284
file_source = read_conf_file(self._filepath)
- namespace = globals()
285
+ namespace = copy.copy(globals())
286
+ # so that __file__ used inside the component points to the correct file
287
+ namespace["__file__"] = os.path.abspath(self._filepath)
288
exec(file_source, namespace) # noqa: P204
289
if self._function_name not in namespace:
290
raise ComponentNotFoundException(
0 commit comments