Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
evoprompt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grießhaber Daniel
evoprompt
Commits
6f2fb95b
Commit
6f2fb95b
authored
1 year ago
by
Grießhaber Daniel
Browse files
Options
Downloads
Patches
Plain Diff
make sure cli options are logged after run directory is initialized
parent
c69122db
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+16
-15
16 additions, 15 deletions
main.py
utils.py
+2
-2
2 additions, 2 deletions
utils.py
with
18 additions
and
17 deletions
main.py
+
16
−
15
View file @
6f2fb95b
...
...
@@ -272,21 +272,6 @@ def run_episode(evo_alg_str: str, debug: bool = False):
if
__name__
==
"
__main__
"
:
options
=
argument_parser
.
parse_args
()
# log cli arguments
logger
.
info
(
"
CLI arguments:
\n\t
Positional:%s
\n\t
Keyword:
\n\t\t
%s
"
,
"
,
"
.
join
(
options
.
_get_args
()),
"
\n\t\t
"
.
join
((
f
"
{
param
}
=
{
value
}
"
for
param
,
value
in
options
.
_get_kwargs
())),
)
# debug mode will allow for a quick run
debug
=
options
.
debug
if
debug
is
None
:
debug
=
conv2bool
(
os
.
getenv
(
"
EP_DEBUG
"
,
False
))
if
debug
is
None
:
raise
ValueError
(
f
"
{
os
.
getenv
(
'
EP_DEBUG
'
)
}
is not allowed for env variable EP_DEBUG.
"
)
# set up evolution model
match
options
.
evolution_engine
:
...
...
@@ -314,6 +299,22 @@ if __name__ == "__main__":
run_directory
=
initialize_run_directory
(
evolution_model
)
# log cli arguments
logger
.
info
(
"
CLI arguments:
\n\t
Positional:%s
\n\t
Keyword:
\n\t\t
%s
"
,
"
,
"
.
join
(
options
.
_get_args
()),
"
\n\t\t
"
.
join
((
f
"
{
param
}
=
{
value
}
"
for
param
,
value
in
options
.
_get_kwargs
())),
)
# debug mode will allow for a quick run
debug
=
options
.
debug
if
debug
is
None
:
debug
=
conv2bool
(
os
.
getenv
(
"
EP_DEBUG
"
,
False
))
if
debug
is
None
:
raise
ValueError
(
f
"
{
os
.
getenv
(
'
EP_DEBUG
'
)
}
is not allowed for env variable EP_DEBUG.
"
)
match
options
.
task
:
case
"
sa
"
:
logger
.
info
(
"
Running with task sentiment analysis on dataset SetFit/sst2
"
)
...
...
This diff is collapsed.
Click to expand it.
utils.py
+
2
−
2
View file @
6f2fb95b
...
...
@@ -29,7 +29,7 @@ def initialize_run_directory(model: OpenAI | Llama2):
run_name
=
uuid4
().
hex
else
:
run_name
=
run_name_match
.
group
(
0
)
run_directory
=
current_directory
/
f
"
runs/
run-
{
run_name
}
"
run_directory
=
current_directory
/
f
"
runs/
{
run_name
}
"
run_directory
.
mkdir
(
parents
=
True
,
exist_ok
=
False
)
file_handler
=
logging
.
FileHandler
(
run_directory
/
"
output.log
"
)
file_handler
.
setLevel
(
logging
.
DEBUG
)
...
...
@@ -37,7 +37,7 @@ def initialize_run_directory(model: OpenAI | Llama2):
file_handler
.
setFormatter
(
formatter
)
logger
.
addHandler
(
file_handler
)
logger
.
info
(
f
"
initialized run directory at
{
run_directory
}
"
)
logger
.
info
(
f
"
Hello my name is
{
run_name
}
and I live in
{
run_directory
}
"
)
return
run_directory
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment