Skip to content

Getting error while implementing Falcon-7B model: AttributeError: module 'signal' has no attribute 'SIGALRM' #25208

@amitkedia007

Description

@amitkedia007

System Info

Screenshot 2023-07-31 134702

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions