Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ColossalAI
Commits
bc09b95f
Unverified
Commit
bc09b95f
authored
Nov 18, 2023
by
flybird11111
Committed by
GitHub
Nov 18, 2023
Browse files
[exampe] fix llama example' loss error when using gemini plugin (#5060)
fix llama example
parent
3c08f173
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
examples/language/llama2/finetune.py
examples/language/llama2/finetune.py
+1
-0
No files found.
examples/language/llama2/finetune.py
View file @
bc09b95f
...
@@ -58,6 +58,7 @@ def tokenize_batch_for_finetune(batch, tokenizer: Optional[LlamaTokenizer] = Non
...
@@ -58,6 +58,7 @@ def tokenize_batch_for_finetune(batch, tokenizer: Optional[LlamaTokenizer] = Non
def
all_reduce_mean
(
tensor
:
torch
.
Tensor
)
->
torch
.
Tensor
:
def
all_reduce_mean
(
tensor
:
torch
.
Tensor
)
->
torch
.
Tensor
:
dist
.
all_reduce
(
tensor
,
op
=
dist
.
ReduceOp
.
SUM
)
dist
.
all_reduce
(
tensor
,
op
=
dist
.
ReduceOp
.
SUM
)
tensor
=
tensor
.
data
tensor
.
div_
(
dist
.
get_world_size
())
tensor
.
div_
(
dist
.
get_world_size
())
return
tensor
return
tensor
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment