Skip to content

Commit

Permalink
write directly to output dir, no need for chat dir bc data in memory
Browse files Browse the repository at this point in the history
Signed-off-by: greg pereira <[email protected]>
  • Loading branch information
Gregory-Pereira committed May 19, 2024
1 parent 2a53e47 commit ac9db5c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions worker/cmd/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ func (w *Worker) runPrecheckScoring(precheckPRAnswers []string, precheckEndpoint
if WorkDir != "" {
workDir = WorkDir
}
chatlogDir := path.Join(workDir, "data", "chatlogs")
combinedYAMLScoringPath := path.Join(outputDir, "combined_chatlog_scoring.yaml")

type QuestionScore struct {
Expand All @@ -244,7 +243,7 @@ func (w *Worker) runPrecheckScoring(precheckPRAnswers []string, precheckEndpoint

yamlData := QuestionScoreReport{}
for i := 0; i < len(precheckPRAnswers); i++ {
err, promptTemplate := generatePrecheckScoringPrompt(precheckPRAnswers[i], precheckPRQuestions[i])
err, promptTemplate := generatePrecheckScoringPrompt(precheckPRAnswers[i], precheckEndpointAnswers[i])
if err != nil {
w.logger.Errorf("Failed to generate a prompt for precheck scorring: %v", err)
return err
Expand Down Expand Up @@ -293,7 +292,7 @@ func (w *Worker) runPrecheckScoring(precheckPRAnswers []string, precheckEndpoint
return err
}

err = os.WriteFile(path.Join(chatlogDir, combinedYAMLScoringPath), scoringYaml, 0644)
err = os.WriteFile(combinedYAMLScoringPath, scoringYaml, 0644)
if err != nil {
w.logger.Errorf("Could not write chatlog to file: %v", err)
return err
Expand Down

0 comments on commit ac9db5c

Please sign in to comment.