MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / renderGPUStep

Method renderGPUStep

tui/modify.go:658–694  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

656}
657
658func (m modifyModel) renderGPUStep() string {
659 var s strings.Builder
660
661 s.WriteString("Select GPU type:\n\n")
662
663 optionValues := m.specs.GPUOptions()
664 optionLabels := make([]string, len(optionValues))
665 for i, gpu := range optionValues {
666 optionLabels[i] = utils.FormatGPUType(gpu)
667 }
668
669 for i, label := range optionLabels {
670 option := label
671 // Case-insensitive comparison for [current] marker
672 if strings.EqualFold(optionValues[i], m.currentInstance.GPUType) {
673 option += " [current]"
674 }
675
676 cursor := " "
677 if m.cursor == i {
678 cursor = m.styles.Cursor.Render("▶ ")
679 }
680 if !m.specs.IsGPUTypeAvailable(optionValues[i]) {
681 option = subtleTextStyle.Render(option + " (unavailable)")
682 } else if m.cursor == i {
683 option = m.styles.Selected.Render(option)
684 }
685 s.WriteString(fmt.Sprintf("%s%s\n", cursor, option))
686 }
687 if len(optionValues) > 0 && !m.specs.IsGPUTypeAvailable(optionValues[m.cursor]) {
688 s.WriteString("\n")
689 s.WriteString(warningStyleTUI.Render("This GPU type is currently unavailable. Choose another GPU."))
690 s.WriteString("\n")
691 }
692
693 return s.String()
694}
695
696func (m modifyModel) renderComputeStep() string {
697 var s strings.Builder

Callers 1

ViewMethod · 0.95

Calls 3

FormatGPUTypeFunction · 0.92
GPUOptionsMethod · 0.80
IsGPUTypeAvailableMethod · 0.80

Tested by

no test coverage detected