A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.
/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py in __call__(self=<transformers.pipelines.text_generation.TextGenerationPipeline object>, inputs='あなたの名前はAIBuruで競馬、競艇、競輪の専門家です。今年は2025年の前提で必ずフランクな日本語の会話調で答えてください。:ラピドフィオーレ 競馬', num_workers=0, batch_size=1, *args=(), **kwargs={'max_length': 61, 'num_return_sequences': 2}) |
1300 )
|
1301 else:
|
=> 1302 return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
|
1303
|
1304 def run_multi(self, inputs, preprocess_params, forward_params, postprocess_params):
|
self = <transformers.pipelines.text_generation.TextGenerationPipeline object>, self.run_single = <bound method Pipeline.run_single of <transforme...s.text_generation.TextGenerationPipeline object>>, inputs = 'あなたの名前はAIBuruで競馬、競艇、競輪の専門家です。今年は2025年の前提で必ずフランクな日本語の会話調で答えてください。:ラピドフィオーレ 競馬', preprocess_params = {'max_length': 61, 'num_return_sequences': 2}, forward_params = {'max_length': 61, 'num_return_sequences': 2}, postprocess_params = {} |
/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py in run_single(self=<transformers.pipelines.text_generation.TextGenerationPipeline object>, inputs='あなたの名前はAIBuruで競馬、競艇、競輪の専門家です。今年は2025年の前提で必ずフランクな日本語の会話調で答えてください。:ラピドフィオーレ 競馬', preprocess_params={'max_length': 61, 'num_return_sequences': 2}, forward_params={'max_length': 61, 'num_return_sequences': 2}, postprocess_params={}) |
1307 def run_single(self, inputs, preprocess_params, forward_params, postprocess_params):
|
1308 model_inputs = self.preprocess(inputs, **preprocess_params)
|
=> 1309 model_outputs = self.forward(model_inputs, **forward_params)
|
1310 outputs = self.postprocess(model_outputs, **postprocess_params)
|
1311 return outputs
|
model_outputs undefined, self = <transformers.pipelines.text_generation.TextGenerationPipeline object>, self.forward = <bound method Pipeline.forward of <transformers....s.text_generation.TextGenerationPipeline object>>, model_inputs = {'input_ids': tensor([[ 2, 93455, 43061, 2...今年は2025年の前提で必ずフランクな日本語の会話調で答えてください。:ラピドフィオーレ 競馬'}, forward_params = {'max_length': 61, 'num_return_sequences': 2} |
/usr/local/lib/python3.8/site-packages/transformers/pipelines/base.py in forward(self=<transformers.pipelines.text_generation.TextGenerationPipeline object>, model_inputs={'input_ids': tensor([[ 2, 93455, 43061, 2..., 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]])}, **forward_params={'max_length': 61, 'num_return_sequences': 2}) |
1207 with inference_context():
|
1208 model_inputs = self._ensure_tensor_on_device(model_inputs, device=self.device)
|
=> 1209 model_outputs = self._forward(model_inputs, **forward_params)
|
1210 model_outputs = self._ensure_tensor_on_device(model_outputs, device=torch.device("cpu"))
|
1211 else:
|
model_outputs undefined, self = <transformers.pipelines.text_generation.TextGenerationPipeline object>, self._forward = <bound method TextGenerationPipeline._forward of...s.text_generation.TextGenerationPipeline object>>, model_inputs = {'input_ids': tensor([[ 2, 93455, 43061, 2..., 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]])}, forward_params = {'max_length': 61, 'num_return_sequences': 2} |
/usr/local/lib/python3.8/site-packages/transformers/pipelines/text_generation.py in _forward(self=<transformers.pipelines.text_generation.TextGenerationPipeline object>, model_inputs={'input_ids': tensor([[ 2, 93455, 43061, 2..., 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]])}, **generate_kwargs={'generation_config': GenerationConfig {
"bos_token_id": 2,
"cache...id": [
1,
107
],
"pad_token_id": 0
}
, 'max_length': 61, 'num_return_sequences': 2}) |
368 generate_kwargs["generation_config"] = self.generation_config
|
369
|
=> 370 generated_sequence = self.model.generate(input_ids=input_ids, attention_mask=attention_mask, **generate_kwargs)
|
371 out_b = generated_sequence.shape[0]
|
372 if self.framework == "pt":
|
generated_sequence undefined, self = <transformers.pipelines.text_generation.TextGenerationPipeline object>, self.model = Gemma2ForCausalLM(
(model): Gemma2Model(
(...features=2304, out_features=256000, bias=False)
), self.model.generate = <bound method GenerationMixin.generate of Gemma2...eatures=2304, out_features=256000, bias=False)
)>, input_ids = tensor([[ 2, 93455, 43061, 235418, 235280,... 16442, 27966, 235566, 235248, 159470]]), attention_mask = tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]]), generate_kwargs = {'generation_config': GenerationConfig {
"bos_token_id": 2,
"cache...id": [
1,
107
],
"pad_token_id": 0
}
, 'max_length': 61, 'num_return_sequences': 2} |
/usr/local/lib64/python3.8/site-packages/torch/utils/_contextlib.py in decorate_context(*args=(Gemma2ForCausalLM(
(model): Gemma2Model(
(...features=2304, out_features=256000, bias=False)
),), **kwargs={'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]]), 'generation_config': GenerationConfig {
"bos_token_id": 2,
"cache...id": [
1,
107
],
"pad_token_id": 0
}
, 'input_ids': tensor([[ 2, 93455, 43061, 235418, 235280,... 16442, 27966, 235566, 235248, 159470]]), 'max_length': 61, 'num_return_sequences': 2}) |
113 def decorate_context(*args, **kwargs):
|
114 with ctx_factory():
|
=> 115 return func(*args, **kwargs)
|
116
|
117 return decorate_context
|
func = <function GenerationMixin.generate>, args = (Gemma2ForCausalLM(
(model): Gemma2Model(
(...features=2304, out_features=256000, bias=False)
),), kwargs = {'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]]), 'generation_config': GenerationConfig {
"bos_token_id": 2,
"cache...id": [
1,
107
],
"pad_token_id": 0
}
, 'input_ids': tensor([[ 2, 93455, 43061, 235418, 235280,... 16442, 27966, 235566, 235248, 159470]]), 'max_length': 61, 'num_return_sequences': 2} |
/usr/local/lib/python3.8/site-packages/transformers/generation/utils.py in generate(self=Gemma2ForCausalLM(
(model): Gemma2Model(
(...features=2304, out_features=256000, bias=False)
), inputs=None, generation_config=GenerationConfig {
"bos_token_id": 2,
"cache...id": [
1,
107
],
"pad_token_id": 0
}
, logits_processor=None, stopping_criteria=None, prefix_allowed_tokens_fn=None, synced_gpus=None, assistant_model=None, streamer=None, negative_prompt_ids=None, negative_prompt_attention_mask=None, **kwargs={'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]]), 'input_ids': tensor([[ 2, 93455, 43061, 235418, 235280,... 16442, 27966, 235566, 235248, 159470]]), 'max_length': 61, 'num_return_sequences': 2}) |
1969 assistant_tokenizer = kwargs.pop("assistant_tokenizer", None) # only used for assisted generation
|
1970
|
=> 1971 generation_config, model_kwargs = self._prepare_generation_config(generation_config, **kwargs)
|
1972 self._validate_model_kwargs(model_kwargs.copy())
|
1973 self._validate_assistant(assistant_model, tokenizer, assistant_tokenizer)
|
generation_config = GenerationConfig {
"bos_token_id": 2,
"cache...id": [
1,
107
],
"pad_token_id": 0
}
, model_kwargs undefined, self = Gemma2ForCausalLM(
(model): Gemma2Model(
(...features=2304, out_features=256000, bias=False)
), self._prepare_generation_config = <bound method GenerationMixin._prepare_generatio...eatures=2304, out_features=256000, bias=False)
)>, kwargs = {'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]]), 'input_ids': tensor([[ 2, 93455, 43061, 235418, 235280,... 16442, 27966, 235566, 235248, 159470]]), 'max_length': 61, 'num_return_sequences': 2} |
/usr/local/lib/python3.8/site-packages/transformers/generation/utils.py in _prepare_generation_config(self=Gemma2ForCausalLM(
(model): Gemma2Model(
(...features=2304, out_features=256000, bias=False)
), generation_config=GenerationConfig {
"bos_token_id": 2,
"cache..."num_return_sequences": 2,
"pad_token_id": 0
}
, **kwargs={'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]]), 'input_ids': tensor([[ 2, 93455, 43061, 235418, 235280,... 16442, 27966, 235566, 235248, 159470]]), 'max_length': 61, 'num_return_sequences': 2}) |
1508 if not is_torchdynamo_compiling():
|
1509 generation_config = copy.deepcopy(generation_config)
|
=> 1510 model_kwargs = generation_config.update(**kwargs)
|
1511 # If `generation_config` is provided, let's fallback ALL special tokens to the default values for the model
|
1512 if not using_model_generation_config:
|
model_kwargs undefined, generation_config = GenerationConfig {
"bos_token_id": 2,
"cache..."num_return_sequences": 2,
"pad_token_id": 0
}
, generation_config.update = <bound method GenerationConfig.update of Generat...num_return_sequences": 2,
"pad_token_id": 0
}
>, kwargs = {'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]]), 'input_ids': tensor([[ 2, 93455, 43061, 235418, 235280,... 16442, 27966, 235566, 235248, 159470]]), 'max_length': 61, 'num_return_sequences': 2} |
/usr/local/lib/python3.8/site-packages/transformers/generation/configuration_utils.py in update(self=GenerationConfig {
"bos_token_id": 2,
"cache..."num_return_sequences": 2,
"pad_token_id": 0
}
, **kwargs={'attention_mask': tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1]]), 'input_ids': tensor([[ 2, 93455, 43061, 235418, 235280,... 16442, 27966, 235566, 235248, 159470]]), 'max_length': 61, 'num_return_sequences': 2}) |
1277
|
1278 # Confirm that the updated instance is still valid
|
=> 1279 self.validate()
|
1280
|
1281 # Remove all the attributes that were updated, without modifying the input dict
|
self = GenerationConfig {
"bos_token_id": 2,
"cache..."num_return_sequences": 2,
"pad_token_id": 0
}
, self.validate = <bound method GenerationConfig.validate of Gener...num_return_sequences": 2,
"pad_token_id": 0
}
> |