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
9462d643
Commit
9462d643
authored
7 months ago
by
Grießhaber Daniel
Browse files
Options
Downloads
Patches
Plain Diff
allow to diable llmaaj by not specifying judgement engine
parent
e751763b
No related branches found
Branches containing commit
No related tags found
1 merge request
!5
Llm as a judge
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
evoprompt/evolution.py
+1
-1
1 addition, 1 deletion
evoprompt/evolution.py
evoprompt/optimization.py
+5
-2
5 additions, 2 deletions
evoprompt/optimization.py
main.py
+1
-4
1 addition, 4 deletions
main.py
with
7 additions
and
7 deletions
evoprompt/evolution.py
+
1
−
1
View file @
9462d643
...
...
@@ -46,7 +46,7 @@ class EvolutionAlgorithm(PromptOptimization, metaclass=ABCMeta):
task
:
Task
,
evolution_model
:
LLMModel
,
evaluation_model
:
LLMModel
,
judge_model
:
LLMModel
,
judge_model
:
LLMModel
|
None
,
run_options
:
dict
[
str
,
Any
]
=
{},
)
->
None
:
super
().
__init__
(
...
...
This diff is collapsed.
Click to expand it.
evoprompt/optimization.py
+
5
−
2
View file @
9462d643
...
...
@@ -24,7 +24,7 @@ PromptSource = Literal["baseprompt", "paraphrase", "evolution", "corrected"]
class
Judgement
(
NamedTuple
):
original_response
:
str
corrected_response
:
str
happy
:
bool
happy
:
bool
|
None
class
PromptMeta
(
TypedDict
):
...
...
@@ -122,7 +122,7 @@ class PromptOptimization:
task
:
Task
,
evolution_model
:
LLMModel
,
evaluation_model
:
LLMModel
,
judge_model
:
LLMModel
,
judge_model
:
LLMModel
|
None
,
run_options
:
dict
[
str
,
Any
]
=
{},
)
->
None
:
self
.
task
=
task
...
...
@@ -278,6 +278,9 @@ class PromptOptimization:
def
judge_and_correct_step
(
self
,
instruction
:
str
,
response
:
str
,
history
:
ChatMessages
)
->
Judgement
:
if
self
.
judge_model
is
None
:
return
Judgement
(
response
,
response
,
happy
=
None
)
# TODO: judge the actual response
judge_happy
=
False
...
...
This diff is collapsed.
Click to expand it.
main.py
+
1
−
4
View file @
9462d643
...
...
@@ -69,13 +69,10 @@ if __name__ == "__main__":
case
"
openai
"
:
logger
.
info
(
f
"
Using
{
options
.
openai_model
}
as the evolution engine
"
)
judge_model
:
LLMModel
judge_model
:
LLMModel
|
None
if
options
.
judge_engine
is
not
None
:
judge_model
=
LLMModel
.
get_model
(
options
.
judge_engine
,
options
=
options
)
logger
.
info
(
f
"
Using
{
options
.
judge_engine
}
as the judge engine
"
)
else
:
judge_model
=
evolution_model
logger
.
info
(
"
Using the same model for judging as for evolution
"
)
# set up evaluation model
# NOTE currenty we always stick to Llama as evaluation engine
...
...
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