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
chenpangpang
transformers
Commits
5744482a
Unverified
Commit
5744482a
authored
Aug 08, 2023
by
Yih-Dar
Committed by
GitHub
Aug 08, 2023
Browse files
Fix `token` in example template (#25351)
fix Co-authored-by:
ydshieh
<
ydshieh@users.noreply.github.com
>
parent
01ab39b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py
...directory_name}}/run_{{cookiecutter.example_shortcut}}.py
+12
-10
No files found.
templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py
View file @
5744482a
...
...
@@ -115,11 +115,13 @@ class ModelArguments:
default
=
"main"
,
metadata
=
{
"help"
:
"The specific model version to use (can be a branch name, tag name or commit id)."
},
)
token
:
bool
=
field
(
default
=
Fals
e
,
token
:
str
=
field
(
default
=
Non
e
,
metadata
=
{
"help"
:
"Will use the token generated when running `huggingface-cli login` (necessary to use this script "
"with private models)."
"help"
:
(
"The token to use as HTTP bearer authorization for remote files. If not specified, will use the token "
"generated when running `huggingface-cli login` (stored in `~/.huggingface`)."
)
},
)
trust_remote_code
:
bool
=
field
(
...
...
@@ -299,7 +301,7 @@ def main():
config_kwargs
=
{
"cache_dir"
:
model_args
.
cache_dir
,
"revision"
:
model_args
.
model_revision
,
"token"
:
True
if
model_args
.
token
else
None
,
"token"
:
model_args
.
token
,
"trust_remote_code"
:
model_args
.
trust_remote_code
,
}
if
model_args
.
config_name
:
...
...
@@ -314,7 +316,7 @@ def main():
"cache_dir"
:
model_args
.
cache_dir
,
"use_fast"
:
model_args
.
use_fast_tokenizer
,
"revision"
:
model_args
.
model_revision
,
"token"
:
True
if
model_args
.
token
else
None
,
"token"
:
model_args
.
token
,
"trust_remote_code"
:
model_args
.
trust_remote_code
,
}
if
model_args
.
tokenizer_name
:
...
...
@@ -334,7 +336,7 @@ def main():
config
=
config
,
cache_dir
=
model_args
.
cache_dir
,
revision
=
model_args
.
model_revision
,
token
=
True
if
model_args
.
token
else
None
,
token
=
model_args
.
token
,
trust_remote_code
=
model_args
.
trust_remote_code
,
)
else
:
...
...
@@ -349,7 +351,7 @@ def main():
finetuning_task
=
data_args
.
task_name
,
cache_dir
=
model_args
.
cache_dir
,
revision
=
model_args
.
model_revision
,
token
=
True
if
model_args
.
token
else
None
,
token
=
model_args
.
token
,
trust_remote_code
=
model_args
.
trust_remote_code
,
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
...
...
@@ -357,7 +359,7 @@ def main():
cache_dir
=
model_args
.
cache_dir
,
use_fast
=
model_args
.
use_fast_tokenizer
,
revision
=
model_args
.
model_revision
,
token
=
True
if
model_args
.
token
else
None
,
token
=
model_args
.
token
,
trust_remote_code
=
model_args
.
trust_remote_code
,
)
model
=
AutoModelForSequenceClassification
.
from_pretrained
(
...
...
@@ -366,7 +368,7 @@ def main():
config
=
config
,
cache_dir
=
model_args
.
cache_dir
,
revision
=
model_args
.
model_revision
,
token
=
True
if
model_args
.
token
else
None
,
token
=
model_args
.
token
,
trust_remote_code
=
model_args
.
trust_remote_code
,
)
{
%
endif
%
}
...
...
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