Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
bauersimon committed Apr 22, 2024
1 parent fd5f9ac commit b2d8587
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion evaluate/report/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ type Markdown struct {
CSVPath string
// LogPath holds the path of detailed logs.
LogPath string
// SVGPath holds the path of the charted results.
// REMARK The charts will be generated during the export.
SVGPath string

// AssessmentPerModel holds
AssessmentPerModel map[string]metrics.Assessments
Expand All @@ -43,6 +46,9 @@ type markdownTemplateContext struct {
// markdownTemplate holds the template for a Markdown report.
var markdownTemplate = template.Must(template.New("template-report").Parse(bytesutil.StringTrimIndentations(`
# Evaluation from {{.DateTime.Format "2006-01-02 15:04:05"}}
{{"{{<"}} img-blog name="{{$svgPath}}" alt="Bar chart that categorizes all evaluated LLMs."{{">}}"}}
This report was generated by [DevQualityEval benchmark](https://github.com/symflower/eval-dev-quality) in ` + "`" + `version {{.Version}}` + "`" + `.
## Results
Expand Down Expand Up @@ -81,7 +87,7 @@ func (m Markdown) Format(writer io.Writer) error {
category := assessment.Category(m.TotalScore)
templateContext.ModelsPerCategory[category] = append(templateContext.ModelsPerCategory[category], model)
}
// TODO Generate svg using maybe https://github.com/wcharczuk/go-chart.
// TODO Generate svg using maybe https://github.com/wcharczuk/go-chart and save to SVGPath.

return pkgerrors.WithStack(markdownTemplate.Execute(writer, templateContext))
}
Expand Down
6 changes: 6 additions & 0 deletions evaluate/report/markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ func TestMarkdownFormat(t *testing.T) {

CSVPath: "some/csv/path.csv",
LogPath: "some/log/path.log",
SVGPath: "some/svg/path.svg",
},

ExpectedReport: `
# Evaluation from 2000-01-01 00:00:00
{{< img-blog name="some/svg/path.svg" alt="Bar chart that categorizes all evaluated LLMs.">}}
This report was generated by [DevQualityEval benchmark](https://github.com/symflower/eval-dev-quality) in ` + "`" + `version 1234` + "`" + `.
## Results
Expand Down Expand Up @@ -81,6 +84,7 @@ func TestMarkdownFormat(t *testing.T) {

CSVPath: "some/csv/path.csv",
LogPath: "some/log/path.log",
SVGPath: "some/svg/path.svg",

TotalScore: 1,
AssessmentPerModel: map[string]metrics.Assessments{
Expand All @@ -95,6 +99,8 @@ func TestMarkdownFormat(t *testing.T) {
ExpectedReport: `
# Evaluation from 2000-01-01 00:00:00
{{< img-blog name="some/svg/path.svg" alt="Bar chart that categorizes all evaluated LLMs.">}}
This report was generated by [DevQualityEval benchmark](https://github.com/symflower/eval-dev-quality) in ` + "`" + `version 1234` + "`" + `.
## Results
Expand Down

0 comments on commit b2d8587

Please sign in to comment.