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
text-generation-inference
Commits
cf04a43f
Unverified
Commit
cf04a43f
authored
Oct 15, 2024
by
Nicolas Patry
Committed by
GitHub
Oct 15, 2024
Browse files
Fixing linters. (#2650)
parent
58848cb4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
15 deletions
+4
-15
docs/openapi.json
docs/openapi.json
+1
-1
server/text_generation_server/models/causal_lm.py
server/text_generation_server/models/causal_lm.py
+2
-9
server/text_generation_server/models/seq2seq_lm.py
server/text_generation_server/models/seq2seq_lm.py
+1
-5
No files found.
docs/openapi.json
View file @
cf04a43f
...
@@ -2186,4 +2186,4 @@
...
@@ -2186,4 +2186,4 @@
"description"
:
"Hugging Face Text Generation Inference API"
"description"
:
"Hugging Face Text Generation Inference API"
}
}
]
]
}
}
\ No newline at end of file
server/text_generation_server/models/causal_lm.py
View file @
cf04a43f
...
@@ -619,18 +619,11 @@ class CausalLM(Model):
...
@@ -619,18 +619,11 @@ class CausalLM(Model):
model_id
,
model_id
,
revision
=
revision
,
revision
=
revision
,
torch_dtype
=
dtype
,
torch_dtype
=
dtype
,
device_map
=
(
device_map
=
(
"auto"
if
device_count
>
1
else
None
),
"auto"
if
device_count
>
1
else
None
),
load_in_8bit
=
quantize
==
"bitsandbytes"
,
load_in_8bit
=
quantize
==
"bitsandbytes"
,
trust_remote_code
=
trust_remote_code
,
trust_remote_code
=
trust_remote_code
,
)
)
if
(
if
device_count
==
1
and
quantize
!=
"bitsandbytes"
:
device_count
==
1
and
quantize
!=
"bitsandbytes"
):
model
=
model
.
to
(
device
)
model
=
model
.
to
(
device
)
if
tokenizer
.
pad_token_id
is
None
:
if
tokenizer
.
pad_token_id
is
None
:
...
...
server/text_generation_server/models/seq2seq_lm.py
View file @
cf04a43f
...
@@ -649,11 +649,7 @@ class Seq2SeqLM(Model):
...
@@ -649,11 +649,7 @@ class Seq2SeqLM(Model):
model_id
,
model_id
,
revision
=
revision
,
revision
=
revision
,
torch_dtype
=
dtype
,
torch_dtype
=
dtype
,
device_map
=
(
device_map
=
(
"auto"
if
device_count
>
1
else
None
),
"auto"
if
device_count
>
1
else
None
),
load_in_8bit
=
quantize
==
"bitsandbytes"
,
load_in_8bit
=
quantize
==
"bitsandbytes"
,
trust_remote_code
=
trust_remote_code
,
trust_remote_code
=
trust_remote_code
,
)
)
...
...
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