Skip to content

ValueError: Requested tokens (5482) exceed context window of ***24 #78

Open
@su-Insight

Description

@su-Insight

workflow在正式运行的时候发生了ValueError,看报错好像是在发送邮件的时候出现了token超出限制所引发的问题,这是什么情况呢,具体运行日志如下:
Rendering Email: %| | / [:<?, ?it/s]
Rendering Email: 2%|▏ | 1/
[2:18<1:52:46, 138.8s/it]
Rendering Email: 4%|▍ | 2/
[3:37<1:22:42, 13.38s/it]
Rendering Email: 6%|▌ | 3/
[5:7<1:16:24, 97.54s/it]
Rendering Email: 8%|▊ | 4/
[6:25<1:8:54, 89.88s/it]
Rendering Email: 1
%|█ | 5/
[7:6<53:59, 71.99s/it]
Rendering Email: 12%|█▏ | 6/
[8:13<51:33, 7.32s/it]
Rendering Email: 12%|█▏ | 6/
[8:3<1:2:2, 85.s/it]
Traceback (most recent call last):
File "/home/runner/work/zotero-arxiv-daily/zotero-arxiv-daily/main.py", line 182, in
html = render_email(papers)
^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zotero-arxiv-daily/zotero-arxiv-daily/construct_email.py", line 138, in render_email
parts.append(get_block_html(p.title, authors,rate,p.arxiv_id ,p.tldr, p.pdf_url, p.code_url, affiliations))
^^^^^^
File "/home/runner/.local/share/uv/python/cpython-3.11.1
-linux-x86_64-gnu/lib/python3.11/functools.py", line 1
1, in get
val = self.func(instance)
^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zotero-arxiv-daily/zotero-arxiv-daily/paper.py", line 177, in tldr
tldr = llm.generate(
^^^^^^^^^^^^^
File "/home/runner/work/zotero-arxiv-daily/zotero-arxiv-daily/llm.py", line 37, in generate
response = self.llm.create_chat_completion(messages=messages,temperature=***)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zotero-arxiv-daily/zotero-arxiv-daily/.venv/lib/python3.11/site-packages/llama_cpp/llama.py", line 1998, in create_chat_completion
return handler(
^^^^^^^^
File "/home/runner/work/zotero-arxiv-daily/zotero-arxiv-daily/.venv/lib/python3.11/site-packages/llama_cpp/llama_chat_format.py", line 637, in chat_completion_handler
completion_or_chunks = llama.create_completion(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zotero-arxiv-daily/zotero-arxiv-daily/.venv/lib/python3.11/site-packages/llama_cpp/llama.py", line 1832, in create_completion
completion: Completion = next(completion_or_chunks) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/zotero-arxiv-daily/zotero-arxiv-daily/.venv/lib/python3.11/site-packages/llama_cpp/llama.py", line 1268, in _create_completion
raise ValueError(
ValueError: Requested tokens (5482) exceed context window of ***24
Error: Process completed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions