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
5adc2072
Commit
5adc2072
authored
Feb 08, 2019
by
thomwolf
Browse files
add distant debugging
parent
5ee4f172
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
examples/run_openai_gpt.py
examples/run_openai_gpt.py
+12
-0
No files found.
examples/run_openai_gpt.py
View file @
5adc2072
...
...
@@ -99,9 +99,21 @@ def main():
parser
.
add_argument
(
'--weight_decay'
,
type
=
float
,
default
=
0.01
)
parser
.
add_argument
(
'--lm_coef'
,
type
=
float
,
default
=
0.5
)
parser
.
add_argument
(
'--n_valid'
,
type
=
int
,
default
=
374
)
parser
.
add_argument
(
'--server_ip'
,
type
=
str
,
default
=
''
)
parser
.
add_argument
(
'--server_port'
,
type
=
str
,
default
=
''
)
args
=
parser
.
parse_args
()
print
(
args
)
# Some distant debugging
# See https://code.visualstudio.com/docs/python/debugging#_attach-to-a-local-script
import
ptvsd
print
(
sys
.
argv
)
print
(
"Waiting for debugger attach"
)
ptvsd
.
enable_attach
(
address
=
(
args
.
server_ip
,
args
.
server_port
),
redirect_output
=
True
)
ptvsd
.
wait_for_attach
()
random
.
seed
(
args
.
seed
)
np
.
random
.
seed
(
args
.
seed
)
torch
.
manual_seed
(
args
.
seed
)
...
...
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