You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

textToImage.go 1.1 kB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package textInference
  2. import (
  3. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/database"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/schedulers/option"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/scheduler/strategy"
  6. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/constants"
  7. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models"
  8. )
  9. const (
  10. TEXTTOIMAGE = "generate_image"
  11. TEXTTOIMAGE_AiTYPE = "14"
  12. )
  13. type TextToImage struct {
  14. clusters []*strategy.AssignedCluster
  15. storage *database.AiStorage
  16. opt *option.InferOption
  17. }
  18. func (t *TextToImage) SaveAiTask(id int64, adapterName string) error {
  19. for _, c := range t.clusters {
  20. clusterName, _ := t.storage.GetClusterNameById(c.ClusterId)
  21. t.opt.Replica = c.Replicas
  22. err := t.storage.SaveAiTask(id, t.opt, adapterName, c.ClusterId, clusterName, "", constants.Saved, "")
  23. if err != nil {
  24. return err
  25. }
  26. }
  27. return nil
  28. }
  29. func (t *TextToImage) UpdateStatus(aiTaskList []*models.TaskAi, adapterName string) error {
  30. return nil
  31. }
  32. func (t *TextToImage) GetAiType() string {
  33. return TEXTTOIMAGE_AiTYPE
  34. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.