-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Assessment for arbitrary response properties of test generation
- Loading branch information
1 parent
a648286
commit 9e4f513
Showing
11 changed files
with
146 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package metrics | ||
|
||
// AssessmentKey is a description for a numerical assessment value. | ||
type AssessmentKey string | ||
|
||
// allAssessmentKeys holds all assessment keys. | ||
var allAssessmentKeys []AssessmentKey | ||
|
||
func registerAssessmentKey(key string) AssessmentKey { | ||
assessment := AssessmentKey(key) | ||
allAssessmentKeys = append(allAssessmentKeys, assessment) | ||
|
||
return assessment | ||
} | ||
|
||
var ( | ||
// AssessmentKeyNoExplanations means that a model did not produce additional explanations. | ||
AssessmentKeyNoExplanations = registerAssessmentKey("no-explanations") | ||
) | ||
|
||
// Assessments holds numerical assessment metrics. | ||
type Assessments map[AssessmentKey]uint | ||
|
||
// Add sums two assessment objects. | ||
func (a Assessments) Add(o Assessments) Assessments { | ||
if a == nil { | ||
a = Assessments{} | ||
} | ||
if o == nil { | ||
o = Assessments{} | ||
} | ||
|
||
assessments := map[AssessmentKey]uint{} | ||
|
||
for _, k := range allAssessmentKeys { | ||
assessments[k] = a[k] + o[k] | ||
} | ||
|
||
return Assessments(assessments) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
make install && eval-dev-quality evaluate \ | ||
--model symflower/symbolic-execution \ | ||
--model openrouter/openrouter/cinematika-7b:free \ | ||
--model openrouter/google/gemma-7b-it:free \ | ||
--model openrouter/gryphe/mythomist-7b:free \ | ||
--model openrouter/mistralai/mistral-7b-instruct:free \ | ||
--model openrouter/nousresearch/nous-capybara-7b:free \ | ||
--model openrouter/undi95/toppy-m-7b:free |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
package model | ||
|
||
import "github.com/symflower/eval-dev-quality/language" | ||
import ( | ||
"github.com/symflower/eval-dev-quality/evaluate/metrics" | ||
"github.com/symflower/eval-dev-quality/language" | ||
) | ||
|
||
// Model defines a model that can be queried for generations. | ||
type Model interface { | ||
// ID returns the unique ID of this model. | ||
ID() (id string) | ||
|
||
// GenerateTestsForFile generates test files for the given implementation file in a repository. | ||
GenerateTestsForFile(language language.Language, repositoryPath string, filePath string) (err error) | ||
GenerateTestsForFile(language language.Language, repositoryPath string, filePath string) (assessments metrics.Assessments, err error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters