When running model in MacOS, terminal is stuck and no output is given
#15
by
sassir
- opened
I am trying to run the following code in MacOS computer with a Python virtual environment:
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model = "tiiuae/falcon-11B"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
)
sequences = pipeline(
"Can you explain the concepts of Quantum Computing?",
max_length=200,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
print(f"Result: {seq['generated_text']}")
I installed the following libraries:
transformers
torch
accelerate>=0.26.0
When I run the previous code (no gpu in my computer), my terminal does not show any output and seems to be blocked at sequences = pipeline
as you can see in the image in attachment.
Am I missing something ?