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
11bd357f
Commit
11bd357f
authored
1 year ago
by
Max Kimmich
Browse files
Options
Downloads
Patches
Plain Diff
Log cli arguments and some more infos
parent
26c64b3e
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
+10
-0
10 additions, 0 deletions
main.py
utils.py
+1
-1
1 addition, 1 deletion
utils.py
with
11 additions
and
1 deletion
main.py
+
10
−
0
View file @
11bd357f
...
...
@@ -281,6 +281,12 @@ 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
...
...
@@ -317,6 +323,7 @@ if __name__ == "__main__":
match
options
.
task
:
case
"
sa
"
:
logger
.
info
(
"
Running with task sentiment analysis on dataset SetFit/sst2
"
)
task
=
SentimentAnalysis
(
evaluation_model
,
"
SetFit/sst2
"
,
...
...
@@ -325,6 +332,7 @@ if __name__ == "__main__":
test_split
=
"
test[:20]
"
if
debug
else
"
test
"
,
)
case
"
qa
"
:
logger
.
info
(
"
Running with task question answering on dataset squad
"
)
task
=
QuestionAnswering
(
evaluation_model
,
"
squad
"
,
...
...
@@ -337,4 +345,6 @@ if __name__ == "__main__":
f
"
Task
{
options
.
task
}
does not exist. Choose from
'
sa
'
,
'
qa
'
.
"
)
logger
.
info
(
"
Using evolutionary algorithm
'
%s
'"
,
options
.
evolution_algorithm
)
run_episode
(
evo_alg_str
=
options
.
evolution_algorithm
,
debug
=
debug
)
This diff is collapsed.
Click to expand it.
utils.py
+
1
−
1
View file @
11bd357f
...
...
@@ -162,7 +162,7 @@ def save_family_tree_visualization(family_tree, P, metric_name: str):
prompt
=
fill
(
str
(
prompt
)),
prompt_generations
=
"
,
"
.
join
(
prompt_generations
(
prompt
)),
score
=
prompt
.
score
,
metric_name
=
metric_name
metric_name
=
metric_name
,
)
dot
.
node
(
f
"
{
node_id
(
prompt
)
}
"
,
...
...
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