-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
请问为什么这里要把loss_scale键删除呢
ms-swift/swift/llm/template/base.py
Line 960 in 70051cc
| encoded[k] = None |
encoded[k] = None
比如我定义loss_scale函数实现token权重["学习", "好", "数学", "是", "重要", "的"][1.0, 0.5, 2.0, 0.5, 2.0, 0.1]
把loss_scale键删除这样后续计算loss不就会不按照token权重计算损失,而计算整句话的平均损失吗
Line 73 in 70051cc
| if loss_scale is not None: |
if loss_scale is not None:
ms-swift/swift/llm/template/base.py
Line 960 in 70051cc
| encoded[k] = None |
这里是指只有{'default', 'all', 'last_round'}这三种会删除键,而自己定义的loss_scale不需要执行这步吗
Metadata
Metadata
Assignees
Labels
No labels