Cannot allocate memory in static TLS block
I am trying to test examples in the website. -https://huggingface.co/distilbert-base-uncased-distilled-squadFist I tried following code:from transformers import pipeline
question_answerer = pipeline("question-answering", model='distilbert-base-uncased-distilled-squad')

context = r"""
Extractive Question Answering is the task of extracting an answer from a text given a question. An example     of a
question answering dataset is the SQuAD dataset, which is entirely based on that task. If you would like to fine-tune
a model on a SQuAD task, you may leverage the examples/pytorch/question-answering/run_squad.py script.
"""

result = question_answerer(question="What is a good example of a question answering dataset?",     context=context)
print(f"Answer: '{result['answer']}', score: {round(result['score'], 4)}, start: {result['start']}, end: {result['end']}")It shows the following error,print(f"Answer: ‘{result[‘answer’]}’, score: {round(result[‘score’], 4)}, start: {result[‘start’]}, end: {result[‘end’]}")TypeError: list indices must be integers or slices, not strWhen I try following code,from transformers import DistilBertTokenizer, DistilBertModel
import torch
tokenizer = DistilBertTokenizer.from_pretrained('distilbert-base-uncased-distilled-squad')
model = DistilBertModel.from_pretrained('distilbert-base-uncased-distilled-squad')

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs)

print(outputs)It given following error,Traceback (most recent call last):File “/usr/local/lib/python3.8/dist-packages/transformers/utils/import_utils.py”, line 1002, in _get_modulereturn importlib.import_module(“.” + module_name, self.name)File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_modulereturn _bootstrap._gcd_import(name[level:], package, level)File “”, line 1014, in _gcd_importFile “”, line 991, in _find_and_loadFile “”, line 961, in _find_and_load_unlockedFile “”, line 219, in _call_with_frames_removedFile “”, line 1014, in _gcd_importFile “”, line 991, in _find_and_loadFile “”, line 975, in _find_and_load_unlockedFile “”, line 671, in _load_unlockedFile “”, line 848, in exec_moduleFile “”, line 219, in _call_with_frames_removedFile “/usr/local/lib/python3.8/dist-packages/transformers/data/init.py”, line 30, infrom .metrics import glue_compute_metrics, xnli_compute_metricsFile “/usr/local/lib/python3.8/dist-packages/transformers/data/metrics/init.py”, line 22, inif is_sklearn_available():File “/usr/local/lib/python3.8/dist-packages/transformers/utils/import_utils.py”, line 492, in is_sklearn_availablereturn is_scipy_available() and importlib.util.find_spec(“sklearn.metrics”)File “/usr/lib/python3.8/importlib/util.py”, line 94, in find_specparent =import(parent_name, fromlist=[‘path’])File “/usr/local/lib/python3.8/dist-packages/sklearn/init.py”, line 83, infrom .utils._show_versions import show_versionsFile “/usr/local/lib/python3.8/dist-packages/sklearn/utils/_show_versions.py”, line 14, infrom ._openmp_helpers import _openmp_parallelism_enabledImportError: /lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS blockThe above exception was the direct cause of the following exception:Traceback (most recent call last):File “/usr/local/lib/python3.8/dist-packages/transformers/utils/import_utils.py”, line 1002, in _get_modulereturn importlib.import_module(“.” + module_name, self.name)File “/usr/lib/python3.8/importlib/init.py”, line 127, in import_modulereturn _bootstrap._gcd_import(name[level:], package, level)File “”, line 1014, in _gcd_importFile “”, line 991, in _find_and_loadFile “”, line 975, in _find_and_load_unlockedFile “”, line 671, in _load_unlockedFile “”, line 848, in exec_moduleFile “”, line 219, in _call_with_frames_removedFile “/usr/local/lib/python3.8/dist-packages/transformers/models/distilbert/modeling_tf_distilbert.py”, line 34, infrom …modeling_tf_utils import (File “/usr/local/lib/python3.8/dist-packages/transformers/modeling_tf_utils.py”, line 42, infrom . import DataCollatorWithPadding, DefaultDataCollatorFile “”, line 1039, in _handle_fromlistFile “/usr/local/lib/python3.8/dist-packages/transformers/utils/import_utils.py”, line 992, ingetattrmodule = self._get_module(self._class_to_module[name])File “/usr/local/lib/python3.8/dist-packages/transformers/utils/import_utils.py”, line 1004, in _get_moduleraise RuntimeError(RuntimeError: Failed to import transformers.data.data_collator because of the following error (look up to see its traceback):/lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS blockThe above exception was the direct cause of the following exception:Traceback (most recent call last):File “/home/user/Desktop/nlp2.py”, line 1, infrom transformers import DistilBertTokenizer, TFDistilBertForQuestionAnsweringFile “”, line 1039, in _handle_fromlistFile “/usr/local/lib/python3.8/dist-packages/transformers/utils/import_utils.py”, line 993, ingetattrvalue = getattr(module, name)File “/usr/local/lib/python3.8/dist-packages/transformers/utils/import_utils.py”, line 992, ingetattrmodule = self._get_module(self._class_to_module[name])File “/usr/local/lib/python3.8/dist-packages/transformers/utils/import_utils.py”, line 1004, in _get_moduleraise RuntimeError(RuntimeError: Failed to import transformers.models.distilbert.modeling_tf_distilbert because of the following error (look up to see its traceback):Failed to import transformers.data.data_collator because of the following error (look up to see its traceback):/lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS blockThe I tried following code:from transformers import DistilBertTokenizer, TFDistilBertForQuestionAnswering
import tensorflow as tf

tokenizer = DistilBertTokenizer.from_pretrained("distilbert-base-uncased-distilled-squad")
model = TFDistilBertForQuestionAnswering.from_pretrained("distilbert-base-uncased-distilled-squad")

question, text = "Who was Jim Henson?", "Jim Henson was a nice puppet"

inputs = tokenizer(question, text, return_tensors="tf")
outputs = model(**inputs)

answer_start_index = int(tf.math.argmax(outputs.start_logits, axis=-1)[0])
answer_end_index = int(tf.math.argmax(outputs.end_logits, axis=-1)[0])

predict_answer_tokens = inputs.input_ids[0, answer_start_index : answer_end_index + 1]
tokenizer.decode(predict_answer_tokens)That given following errorSome weights of the model checkpoint at distilbert-base-uncased-distilled-squad were not used when initializing DistilBertModel: [‘qa_outputs.weight’, ‘qa_outputs.bias’]This IS expected if you are initializing DistilBertModel from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).This IS NOT expected if you are initializing DistilBertModel from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).BaseModelOutput(last_hidden_state=tensor([[[nan, nan, nan,  …, nan, nan, nan],[nan, nan, nan,  …, nan, nan, nan],[nan, nan, nan,  …, nan, nan, nan],…,[nan, nan, nan,  …, nan, nan, nan],[nan, nan, nan,  …, nan, nan, nan],[nan, nan, nan,  …, nan, nan, nan]]]), hidden_states=None, attentions=None)I think all error are relatted to memory allocate. How can i solve this issue?