-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Getting error while implementing Falcon-7B model: AttributeError: module 'signal' has no attribute 'SIGALRM' #25208
Description
System Info
Who can help?
No response
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
from transformers import AutoTokenizer, pipeline
Load the tokenizer
model_name = "tiiuae/falcon-7b"
tokenizer = AutoTokenizer.from_pretrained(model_name)
Create a text generation pipeline
text_generator = pipeline("text-generation", model=model_name, tokenizer=tokenizer)
Generate text
input_text = "Hello! How are you?"
output = text_generator(input_text, max_length=100, do_sample=True)
generated_text = output[0]["generated_text"]
Print the generated text
print(generated_text)
Expected behavior
It should get the text generated by the model. But it was showing me this error:
"Traceback (most recent call last):
File "C:\DissData\Dissertation-Brunel\Falcon-7b.py", line 8, in
text_generator = pipeline("text-generation", model=model_name, tokenizer=tokenizer)
File "C:\Users\2267302\AppData\Roaming\Python\Python39\site-packages\transformers\pipelines_init_.py", line 705, in pipeline
config = AutoConfig.from_pretrained(model, _from_pipeline=task, **hub_kwargs, **model_kwargs)
File "C:\Users\2267302\AppData\Roaming\Python\Python39\site-packages\transformers\models\auto\configuration_auto.py", line 986, in from_pretrained
trust_remote_code = resolve_trust_remote_code(
File "C:\Users\2267302\AppData\Roaming\Python\Python39\site-packages\transformers\dynamic_module_utils.py", line 535, in resolve_trust_remote_code
signal.signal(signal.SIGALRM, _raise_timeout_error)
AttributeError: module 'signal' has no attribute 'SIGALRM'"
Is it possible to resolve this error as soon as possible?
