AttributeError: module 'torch._dynamo' has no attribute 'mark_static_address'

#16
by yusufcakmak - opened

Hello, when I try to run the code below, I get the "AttributeError: module 'torch._dynamo' has no attribute 'mark_static_address'" error. Do you have any solutions for this?

transformers 4.43.3
torch 2.0.1
import transformers
model_id = "google/gemma-2-2b"

pipeline = transformers.pipeline(
    "text-generation",
    model=model_id,
    device_map="auto"
)

text = "Any text here"
outputs = pipeline(text, max_new_tokens=1024)
response = outputs[0]["generated_text"]
print(response)

I solved problem with the following torch installation:

pip install torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1

yusufcakmak changed discussion status to closed

Sign up or log in to comment