Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add precheck scoring functionality #356

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ui/apiserver/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ func (api *ApiServer) runIlabChatCommand(question, context string) (string, erro
cmd = exec.Command("echo", cmdArgs...)
api.logger.Infof("Running in test mode: %s", commandStr)
} else {
modelName, err := api.fetchModelName(true)
modelName, err := api.fetchModelName(true, api.preCheckEndpointURL)
vishnoianil marked this conversation as resolved.
Show resolved Hide resolved
if err != nil {
api.logger.Errorf("Failed to fetch model name: %v", err)
return "failed to retrieve the model name", err
Expand Down Expand Up @@ -382,9 +382,8 @@ func setupLogger(debugMode bool) *zap.SugaredLogger {

// fetchModelName hits the defined precheck endpoint with "/models" appended to extract the model name.
// If fullName is true, it returns the entire ID value; if false, it returns the parsed out name after the double hyphens.
func (api *ApiServer) fetchModelName(fullName bool) (string, error) {
func (api *ApiServer) fetchModelName(fullName bool, endpoint string) (string, error) {
// Ensure the endpoint URL ends with "/models"
endpoint := api.preCheckEndpointURL
if !strings.HasSuffix(endpoint, "/") {
endpoint += "/"
}
Expand Down
Loading