You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot import my custom logic from other modules in executor.py.
Here's my executor.py:
from jina import Executor, requests
from docarray import DocList
from docarray.documents import TextDoc
from fake_agent import predict
class MyExecutor(Executor):
@requests(on='/prompt')
def promt(self, docs: DocList[TextDoc], **kwargs) -> DocList[TextDoc]:
print(docs.text)
docs.text = [predict(a) for a in docs.text]
# docs[1].text = 'goodbye, world!'
return docs
I'm serving the executor using jina deployment --uses deployment.yml
But I'm getting ImportError:
ImportError('can not import module from
C:\\Users\\Lenovo\\Desktop\\jina-exp\\executor1\\executor.py') during 'WorkerRuntime'
initialization
add "--quiet-error" to suppress the exception details
Traceback (most recent call last):
File "C:\programs\anaconda\envs\jina_llm\lib\site-packages\jina\importer.py", line 149, in _path_import
spec.loader.exec_module(module)
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Users\Lenovo\Desktop\jina-exp\executor1\executor.py", line 4, in <module>
from fake_agent import predict
ModuleNotFoundError: No module named 'fake_agent'
which eventually is causing
jina.excepts.RuntimeFailToStart
What am I doing wrong?
Please guide me to appropriate docs or issues regarding this if exists.
Environment
jina 3.22.4
docarray 0.39.1
jcloud 0.3
jina-hubble-sdk 0.39.0
jina-proto 0.1.27
protobuf 4.25.0
proto-backend upb
grpcio 1.47.5
pyyaml 6.0.1
python 3.9.0
platform Windows
platform-release 10
platform-version 10.0.19041
architecture AMD64
processor Intel64 Family 6 Model 165 Stepping 2, GenuineIntel
uid 273085306477006
session-id be030012-83e9-11ee-bc64-f85ea0af99ce
uptime 2023-11-16T00:34:02.782899
ci-vendor (unset)
internal False
JINA_DEFAULT_HOST (unset)
JINA_DEFAULT_TIMEOUT_CTRL (unset)
JINA_DEPLOYMENT_NAME (unset)
JINA_DISABLE_UVLOOP (unset)
JINA_EARLY_STOP (unset)
JINA_FULL_CLI (unset)
JINA_GATEWAY_IMAGE (unset)
JINA_GRPC_RECV_BYTES (unset)
JINA_GRPC_SEND_BYTES (unset)
JINA_HUB_NO_IMAGE_REBUILD (unset)
JINA_LOG_CONFIG (unset)
JINA_LOG_LEVEL (unset)
JINA_LOG_NO_COLOR (unset)
JINA_MP_START_METHOD (unset)
JINA_OPTOUT_TELEMETRY (unset)
JINA_RANDOM_PORT_MAX (unset)
JINA_RANDOM_PORT_MIN (unset)
JINA_LOCKS_ROOT (unset)
JINA_K8S_ACCESS_MODES (unset)
JINA_K8S_STORAGE_CLASS_NAME (unset)
JINA_K8S_STORAGE_CAPACITY (unset)
JINA_STREAMER_ARGS (unset)
The text was updated successfully, but these errors were encountered:
Describe your proposal/problem
Cannot import my custom logic from other modules in executor.py.
Here's my executor.py:
This is the project structure:
I'm serving the executor using
jina deployment --uses deployment.yml
But I'm getting ImportError:
which eventually is causing
What am I doing wrong?
Please guide me to appropriate docs or issues regarding this if exists.
Environment
The text was updated successfully, but these errors were encountered: