Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error running stride-gpt on local. #45

Open
shahbagdadi opened this issue Sep 30, 2024 · 3 comments
Open

Error running stride-gpt on local. #45

shahbagdadi opened this issue Sep 30, 2024 · 3 comments

Comments

@shahbagdadi
Copy link

I followed the steps listed here https://github.com/mrwadams/stride-gpt?tab=readme-ov-file#option-1-cloning-the-repository to run this on my local and am getting the following error. Please help !!

2024-09-30 11:35:22.418 Uncaught app exception
Traceback (most recent call last):
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 590, in code_to_exec
exec(code, module.dict)
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/main.py", line 14, in
from threat_model import create_threat_model_prompt, get_threat_model, get_threat_model_azure, get_threat_model_google, get_threat_model_mistral, get_threat_model_ollama, json_to_markdown, get_image_analysis, create_image_analysis_prompt
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/threat_model.py", line 3, in
from mistralai import Mistral, UserMessage
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/mistralai/init.py", line 3, in
from .sdk import *
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/mistralai/sdk.py", line 3, in
from .basesdk import BaseSDK
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/mistralai/basesdk.py", line 3, in
from .sdkconfiguration import SDKConfiguration
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/mistralai/sdkconfiguration.py", line 8, in
from mistralai import models
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/mistralai/models/init.py", line 3, in
from .agentscompletionrequest import AgentsCompletionRequest, AgentsCompletionRequestMessages, AgentsCompletionRequestMessagesTypedDict, AgentsCompletionRequestStop, AgentsCompletionRequestStopTypedDict, AgentsCompletionRequestToolChoice, AgentsCompletionRequestTypedDict
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/mistralai/models/agentscompletionrequest.py", line 4, in
from .assistantmessage import AssistantMessage, AssistantMessageTypedDict
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/mistralai/models/assistantmessage.py", line 4, in
from .toolcall import ToolCall, ToolCallTypedDict
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/mistralai/models/toolcall.py", line 16, in
class ToolCall(BaseModel):
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 200, in new
set_model_fields(cls, bases, config_wrapper, types_namespace)
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/pydantic/_internal/_model_construction.py", line 469, in set_model_fields
fields, class_vars = collect_model_fields(cls, bases, config_wrapper, types_namespace, typevars_map=typevars_map)
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/pydantic/_internal/_fields.py", line 132, in collect_model_fields
type_hints = get_cls_type_hints_lenient(cls, types_namespace)
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/pydantic/_internal/_typing_extra.py", line 228, in get_cls_type_hints_lenient
hints[name] = eval_type_lenient(value, globalns, localns)
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/pydantic/_internal/_typing_extra.py", line 240, in eval_type_lenient
return eval_type_backport(value, globalns, localns)
File "/Users/sbagdadi/Documents/playground/Inferno/stride-gpt/venv/lib/python3.9/site-packages/pydantic/_internal/_typing_extra.py", line 264, in eval_type_backport
return typing._eval_type( # type: ignore
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/typing.py", line 290, in _eval_type
return t._evaluate(globalns, localns, recursive_guard)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/typing.py", line 546, in _evaluate
eval(self.forward_code, globalns, localns),
File "", line 1, in
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/typing.py", line 275, in inner
return func(*args, **kwds)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/typing.py", line 1305, in class_getitem
origin = _type_check(params[0], msg)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/typing.py", line 156, in _type_check
raise TypeError(f"{arg} is not valid as type argument")
TypeError: typing.Final[typing.Optional[str]] is not valid as type argument

@mrwadams
Copy link
Owner

Hi @shahbagdadi,

When does the error occur?

@shahbagdadi
Copy link
Author

When I start the service using 'streamlit run main.py'

@hype8912
Copy link

Have you tried using a higher version of Python instead of 3.9? I slightly remember I had issues running on older versions of Python and had to use 3.10 and above. I know it works on 3.10, 3.11, 3.12, and 3.13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants