ariG23498 HF Staff commited on
Commit
91f2609
·
verified ·
1 Parent(s): c42d06e

Upload PleIAs_Baguettotron_0.txt with huggingface_hub

Browse files
Files changed (1) hide show
  1. PleIAs_Baguettotron_0.txt +37 -0
PleIAs_Baguettotron_0.txt ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```CODE:
2
+ # Use a pipeline as a high-level helper
3
+ from transformers import pipeline
4
+
5
+ pipe = pipeline("text-generation", model="PleIAs/Baguettotron")
6
+ messages = [
7
+ {"role": "user", "content": "Who are you?"},
8
+ ]
9
+ pipe(messages)
10
+ ```
11
+
12
+ ERROR:
13
+ Traceback (most recent call last):
14
+ File "/tmp/PleIAs_Baguettotron_07mtSLc.py", line 30, in <module>
15
+ pipe(messages)
16
+ ~~~~^^^^^^^^^^
17
+ File "/tmp/.cache/uv/environments-v2/54d28e31a94a0260/lib/python3.13/site-packages/transformers/pipelines/text_generation.py", line 325, in __call__
18
+ return super().__call__(Chat(text_inputs), **kwargs)
19
+ ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20
+ File "/tmp/.cache/uv/environments-v2/54d28e31a94a0260/lib/python3.13/site-packages/transformers/pipelines/base.py", line 1467, in __call__
21
+ return self.run_single(inputs, preprocess_params, forward_params, postprocess_params)
22
+ ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
+ File "/tmp/.cache/uv/environments-v2/54d28e31a94a0260/lib/python3.13/site-packages/transformers/pipelines/base.py", line 1473, in run_single
24
+ model_inputs = self.preprocess(inputs, **preprocess_params)
25
+ File "/tmp/.cache/uv/environments-v2/54d28e31a94a0260/lib/python3.13/site-packages/transformers/pipelines/text_generation.py", line 363, in preprocess
26
+ inputs = self.tokenizer.apply_chat_template(
27
+ prompt_text.messages,
28
+ ...<4 lines>...
29
+ **tokenizer_kwargs,
30
+ )
31
+ File "/tmp/.cache/uv/environments-v2/54d28e31a94a0260/lib/python3.13/site-packages/transformers/tokenization_utils_base.py", line 1646, in apply_chat_template
32
+ chat_template = self.get_chat_template(chat_template, tools)
33
+ File "/tmp/.cache/uv/environments-v2/54d28e31a94a0260/lib/python3.13/site-packages/transformers/tokenization_utils_base.py", line 1824, in get_chat_template
34
+ raise ValueError(
35
+ ...<4 lines>...
36
+ )
37
+ ValueError: Cannot use chat template functions because tokenizer.chat_template is not set and no template argument was passed! For information about writing templates and setting the tokenizer.chat_template attribute, please see the documentation at https://huggingface.co/docs/transformers/main/en/chat_templating