mirror of
https://github.com/hpcaitech/ColossalAI.git
synced 2025-08-24 18:51:33 +00:00
fix bug, tested
This commit is contained in:
parent
177144794b
commit
de40c736d0
4
.gitignore
vendored
4
.gitignore
vendored
@ -167,3 +167,7 @@ applications/ColossalChat/wandb
|
|||||||
applications/ColossalChat/model
|
applications/ColossalChat/model
|
||||||
applications/ColossalChat/eval
|
applications/ColossalChat/eval
|
||||||
applications/ColossalChat/rollouts
|
applications/ColossalChat/rollouts
|
||||||
|
applications/ColossalChat/*.txt
|
||||||
|
applications/ColossalChat/*.db
|
||||||
|
applications/ColossalChat/stdin
|
||||||
|
applications/ColossalChat/*.zip
|
||||||
|
@ -132,9 +132,7 @@ class BaseConsumer:
|
|||||||
format_acc = raw_batch["format_acc"][:, :, 0]
|
format_acc = raw_batch["format_acc"][:, :, 0]
|
||||||
ans_acc = raw_batch["ans_acc"][:, :, 0]
|
ans_acc = raw_batch["ans_acc"][:, :, 0]
|
||||||
response_len = (
|
response_len = (
|
||||||
raw_batch["response_idx"][:, :, 1]
|
raw_batch["response_idx"][:, :, 1] - raw_batch["response_idx"][:, :, 0] + 1
|
||||||
- raw_batch["response_idx"][:, :, 0]
|
|
||||||
+ 1
|
|
||||||
).type(torch.float32)
|
).type(torch.float32)
|
||||||
effective_group_mask = None
|
effective_group_mask = None
|
||||||
if self.filter_range is not None and self.grpo_config.get("dynamic_batching", True):
|
if self.filter_range is not None and self.grpo_config.get("dynamic_batching", True):
|
||||||
|
@ -291,7 +291,7 @@ class BaseProducer:
|
|||||||
reward_model_output = self.reward_model(
|
reward_model_output = self.reward_model(
|
||||||
outputs["input_ids"].view((-1, outputs["input_ids"].size(-1))),
|
outputs["input_ids"].view((-1, outputs["input_ids"].size(-1))),
|
||||||
gt_answer=gt_answer,
|
gt_answer=gt_answer,
|
||||||
response_idx=outputs["response_idx"],
|
response_idx=outputs["response_idx"].view((-1, 2)),
|
||||||
)
|
)
|
||||||
outputs["reward"] = (
|
outputs["reward"] = (
|
||||||
torch.tensor([value[0] for value in reward_model_output])
|
torch.tensor([value[0] for value in reward_model_output])
|
||||||
|
Loading…
Reference in New Issue
Block a user