devika icon indicating copy to clipboard operation
devika copied to clipboard

[Bug] Getting error "unsupported operand type(s) for |: 'type' and 'type'"

Open lalitgupta-blr opened this issue 1 year ago • 1 comments

Describe the bug

A clear and concise description of what the bug is.

% python3 devika.py 24.07.14 17:14:23: root: INFO : Initializing Devika... 24.07.14 17:14:23: root: INFO : checking configurations... 24.07.14 17:14:23: root: INFO : Initializing Prerequisites Jobs... 24.07.14 17:14:28: root: INFO : Loading sentence-transformer BERT models... 24.07.14 17:14:32: root: INFO : BERT model loaded successfully. 24.07.14 17:14:33: root: WARNING: Ollama not available 24.07.14 17:14:33: root: WARNING: run ollama server to use ollama models otherwise use API models huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: - Avoid using tokenizers before the fork if possible - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false) huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: - Avoid using tokenizers before the fork if possible - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false) Traceback (most recent call last): File "/Users/lg/Perseeq/Devika/devika/devika.py", line 24, in from src.agents import Agent File "/Users/lg/Perseeq/Devika/devika/src/agents/init.py", line 1, in from .agent import Agent File "/Users/lg/Perseeq/Devika/devika/src/agents/agent.py", line 2, in from .researcher import Researcher File "/Users/lg/Perseeq/Devika/devika/src/agents/researcher/init.py", line 1, in from .researcher import Researcher File "/Users/lg/Perseeq/Devika/devika/src/agents/researcher/researcher.py", line 13, in class Researcher: File "/Users/lg/Perseeq/Devika/devika/src/agents/researcher/researcher.py", line 27, in Researcher def validate_response(self, response: str) -> dict | bool: TypeError: unsupported operand type(s) for |: 'type' and 'type'

How To Reproduce

Steps to reproduce the behavior (example):

  1. {steps_1}
  2. {steps_2}
  3. {steps_3} After downloading from default branch : pip install -r requirements.txt pip install protobuf==3.20.1
    python3 devika.py

Expected behavior

A clear and concise description of what you expected to happen. WebUI on port 3000 should open

Screenshots and logs

must share logs from frontend or backend. also If applicable, add screenshots to help explain your problem. 24.07.14 17:14:23: root: INFO : Initializing Devika... 24.07.14 17:14:23: root: INFO : checking configurations... 24.07.14 17:14:23: root: INFO : Initializing Prerequisites Jobs... 24.07.14 17:14:28: root: INFO : Loading sentence-transformer BERT models... 24.07.14 17:14:32: root: INFO : BERT model loaded successfully. 24.07.14 17:14:33: root: WARNING: Ollama not available 24.07.14 17:14:33: root: WARNING: run ollama server to use ollama models otherwise use API models huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: - Avoid using tokenizers before the fork if possible - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false) huggingface/tokenizers: The current process just got forked, after parallelism has already been used. Disabling parallelism to avoid deadlocks... To disable this warning, you can either: - Avoid using tokenizers before the fork if possible - Explicitly set the environment variable TOKENIZERS_PARALLELISM=(true | false) Traceback (most recent call last): File "/Users/lg/Perseeq/Devika/devika/devika.py", line 24, in from src.agents import Agent File "/Users/lg/Perseeq/Devika/devika/src/agents/init.py", line 1, in from .agent import Agent File "/Users/lg/Perseeq/Devika/devika/src/agents/agent.py", line 2, in from .researcher import Researcher File "/Users/lg/Perseeq/Devika/devika/src/agents/researcher/init.py", line 1, in from .researcher import Researcher File "/Users/lg/Perseeq/Devika/devika/src/agents/researcher/researcher.py", line 13, in class Researcher: File "/Users/lg/Perseeq/Devika/devika/src/agents/researcher/researcher.py", line 27, in Researcher def validate_response(self, response: str) -> dict | bool: TypeError: unsupported operand type(s) for |: 'type' and 'type'

Configuration

- OS: [e.g. Windows, Linux, MacOS] MacOS
- Python version: [e.g. 3.10]  3.9.7
- Node version: [e.g. 18.0.0] v15.14.0
- bun version: [e.g. 0.1.0] 
- search engine: [e.g. google] default
- Model: [e.g. gpt, cluade] default

Additional context

Add any other context about the problem here.

lalitgupta-blr avatar Jul 14 '24 11:07 lalitgupta-blr

Same outcome with python 3.10 (after using brew install [email protected])

lalitgupta-blr avatar Jul 14 '24 11:07 lalitgupta-blr

You have to use Python 3.10 or the letter version.

ARajgor avatar Aug 28 '24 17:08 ARajgor