mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-11 12:24:53 +00:00
use GPT2TokenizerFast by default
This commit is contained in:
parent
dcfefc425a
commit
275a61aae6
@ -38,7 +38,7 @@ class FlashDbrx(FlashCausalLM):
|
|||||||
raise NotImplementedError("FlashDBRX is only available on GPU")
|
raise NotImplementedError("FlashDBRX is only available on GPU")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tokenizer = AutoTokenizer.from_pretrained(
|
tokenizer = GPT2TokenizerFast.from_pretrained(
|
||||||
model_id,
|
model_id,
|
||||||
revision=revision,
|
revision=revision,
|
||||||
padding_side="left",
|
padding_side="left",
|
||||||
@ -48,16 +48,27 @@ class FlashDbrx(FlashCausalLM):
|
|||||||
from_slow=False,
|
from_slow=False,
|
||||||
)
|
)
|
||||||
except:
|
except:
|
||||||
# FIXME: change back to model id once the tokenizer.json is merged
|
try:
|
||||||
tokenizer = GPT2TokenizerFast.from_pretrained(
|
tokenizer = AutoTokenizer.from_pretrained(
|
||||||
"Xenova/dbrx-instruct-tokenizer",
|
model_id,
|
||||||
revision=revision,
|
revision=revision,
|
||||||
padding_side="left",
|
padding_side="left",
|
||||||
truncation_side="left",
|
truncation_side="left",
|
||||||
trust_remote_code=trust_remote_code,
|
trust_remote_code=trust_remote_code,
|
||||||
use_fast=True,
|
use_fast=True,
|
||||||
from_slow=False,
|
from_slow=False,
|
||||||
)
|
)
|
||||||
|
except:
|
||||||
|
# FIXME: change back to model id once the tokenizer.json is merged
|
||||||
|
tokenizer = GPT2TokenizerFast.from_pretrained(
|
||||||
|
"Xenova/dbrx-instruct-tokenizer",
|
||||||
|
revision=revision,
|
||||||
|
padding_side="left",
|
||||||
|
truncation_side="left",
|
||||||
|
trust_remote_code=trust_remote_code,
|
||||||
|
use_fast=True,
|
||||||
|
from_slow=False,
|
||||||
|
)
|
||||||
|
|
||||||
config = DbrxConfig.from_pretrained(
|
config = DbrxConfig.from_pretrained(
|
||||||
model_id, revision=revision, trust_remote_code=trust_remote_code
|
model_id, revision=revision, trust_remote_code=trust_remote_code
|
||||||
|
Loading…
Reference in New Issue
Block a user