@@ -218,7 +218,7 @@ var generateCmd = &cobra.Command{
218
218
219
219
func (w * Worker ) runPrecheckScoring (precheckPRAnswers []string , precheckEndpointAnswers []string , precheckPRQuestions []string , lab string , outputDir string , preCheckScoringModelName string ) error {
220
220
if len (precheckPRAnswers ) != len (precheckEndpointAnswers ) {
221
- errMsg := "PR questions a Endpoint answers returned a different number of entries, something went wrong. "
221
+ errMsg := "PR questions a Endpoint answers returned a different number of entries, something went wrong"
222
222
w .logger .Error (errMsg )
223
223
return fmt .Errorf (errMsg )
224
224
}
@@ -638,7 +638,7 @@ func (w *Worker) processJob() {
638
638
// sdg-svc does not have a models endpoint as yet
639
639
if jobType != jobSDG && PreCheckEndpointURL != localEndpoint {
640
640
var err error
641
- modelName , err = w .fetchModelName (true )
641
+ modelName , err = w .fetchModelName (true , w . precheckEndpoint )
642
642
if err != nil {
643
643
w .logger .Errorf ("Failed to fetch model name: %v" , err )
644
644
modelName = "unknown"
@@ -683,7 +683,21 @@ func (w *Worker) processJob() {
683
683
w .reportJobError (err )
684
684
return
685
685
}
686
- err = w .runPrecheckScoring (precheckPRAnswers , precheckEndpointAnswers , precheckPRQuestions , lab , outputDir , modelName )
686
+
687
+ var scoringModelName string
688
+ // sdg-svc does not have a models endpoint as yet
689
+ if jobType == jobPreCheck && w .precheckScoringEndpoint != localEndpoint {
690
+ var err error
691
+ scoringModelName , err = w .fetchModelName (true , w .precheckScoringEndpoint )
692
+ if err != nil {
693
+ w .logger .Errorf ("Failed to fetch model name: %v" , err )
694
+ scoringModelName = "unknown"
695
+ }
696
+ } else {
697
+ scoringModelName = w .getModelNameFromConfig () // will default to standard precheck model
698
+ }
699
+
700
+ err = w .runPrecheckScoring (precheckPRAnswers , precheckEndpointAnswers , precheckPRQuestions , lab , outputDir , scoringModelName )
687
701
if err != nil {
688
702
sugar .Errorf ("Could not run scoring on result of precheck: %v" , err )
689
703
w .reportJobError (err )
@@ -975,9 +989,9 @@ func (w *Worker) getModelNameFromConfig() string {
975
989
976
990
// fetchModelName hits the defined precheckEndpoint with "/models" appended to extract the model name.
977
991
// If fullName is true, it returns the entire ID value; if false, it returns the parsed out name after the double hyphens.
978
- func (w * Worker ) fetchModelName (fullName bool ) (string , error ) {
992
+ func (w * Worker ) fetchModelName (fullName bool , endpoint string ) (string , error ) {
979
993
// Ensure the endpoint URL ends with "/models"
980
- endpoint := w .precheckEndpoint
994
+ // endpoint := w.precheckEndpoint
981
995
if ! strings .HasSuffix (endpoint , "/" ) {
982
996
endpoint += "/"
983
997
}
@@ -1073,7 +1087,7 @@ func (w *Worker) determineModelName(jobType string) string {
1073
1087
1074
1088
// precheck is the only case we use a remote OpenAI endpoint right now
1075
1089
if PreCheckEndpointURL != localEndpoint && jobType == jobPreCheck {
1076
- modelName , err := w .fetchModelName (false )
1090
+ modelName , err := w .fetchModelName (false , w . precheckEndpoint )
1077
1091
if err != nil {
1078
1092
w .logger .Errorf ("Failed to fetch model name: %v" , err )
1079
1093
return "unknown"
0 commit comments