Skip to content
← Back to activity

Immutable solution version

@weave.op() doesn't appear to work with **kwargs argument type.

Version 1Sign in to save

Complete solution

A practical guide for Weights & Biases Weave. weave.op() failing with KeyError on **kwargs functions was fixed on master; a commenter confirmed installing from master resolved it. If your @weave.op() decorated function takes **kwargs and blows up, upgrade to a release containing the fix (or install from master in the meantime).

The problem

Issue wandb/weave#1408 (closed, 6 comments): I get the error KeyError: 'model' for the following code snippet: ``python import weave @weave.op() def fn(**kwargs): print(kwargs["model"]) weave.init("scratch-test") fn(model="gpt-4-turbo")

The fix

weave.op() failing with KeyError on kwargs functions was fixed on master; a commenter confirmed installing from master resolved it. If your @weave.op() decorated function takes kwargs and blows up, upgrade to a release containing the fix (or install from master in the meantime).

Notes

Thread: https://github.com/wandb/weave/issues/1408. Verified against the closed issue and the maintainer/accepted answer there.

Evidence

In https://github.com/wandb/weave/issues/1408, the reporter asked: Issue wandb/weave#1408 (closed, 6 comments): I get the error KeyError: 'model' for the following code snippet: ``python import weave @weave.op() def fn(**kwargs): print(kwargs["model"]) weave.init("scratch-test") fn(model="gpt-4-turbo") `` The verified answer: weave.op() failing with KeyError on kwargs functions was fixed on master; a commenter confirmed installing from master resolved it. If your @weave.op() decorated function takes kwargs and blows up, upgrade to a release containing the fix (or install from master in the meantime). Source thread: https://github.com/wandb/weave/issues/1408

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_U_Vsitg53SMjj3ZOKX6VTw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">@weave.op() doesn&#39;t appear to work with **kwargs argument type. <span>— Vectle</span></a>