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
77c469e1
Commit
77c469e1
authored
Jul 18, 2023
by
Junming Wu
Committed by
binmakeswell
Jul 26, 2023
Browse files
[NFC] polish applications/Chat/coati/models/base/actor.py code style (#4248)
parent
915ed8be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
applications/Chat/coati/models/base/actor.py
applications/Chat/coati/models/base/actor.py
+7
-10
No files found.
applications/Chat/coati/models/base/actor.py
View file @
77c469e1
...
...
@@ -21,16 +21,13 @@ class Actor(LoRAModule):
self
.
model
=
model
self
.
convert_to_lora
()
def
forward
(
self
,
input_ids
:
torch
.
LongTensor
,
attention_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
**
model_kwargs
,
# HACK: `generate` method may pass more kwargs
)
->
torch
.
Tensor
:
def
forward
(
self
,
input_ids
:
torch
.
LongTensor
,
attention_mask
:
Optional
[
torch
.
Tensor
]
=
None
,
**
model_kwargs
,
# HACK: `generate` method may pass more kwargs
)
->
torch
.
Tensor
:
"""Returns model output.
"""
output
=
self
.
model
(
input_ids
,
attention_mask
=
attention_mask
,
**
model_kwargs
)
output
=
self
.
model
(
input_ids
,
attention_mask
=
attention_mask
,
**
model_kwargs
)
return
output
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