(improvement)(chat) Add model name set in ModelCluster (#449)

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2023-11-29 12:13:26 +08:00
committed by GitHub
parent 576fad5fb1
commit c11a242f34
2 changed files with 7 additions and 5 deletions

View File

@@ -4,8 +4,7 @@ public enum CostType {
MAPPER(1, "mapper"),
PARSER(2, "parser"),
QUERY(3, "query"),
PARSERRESPONDER(4, "responder"),
PROCESSOR(5, "processor");
PROCESSOR(4, "processor");
private Integer type;
private String name;

View File

@@ -16,6 +16,8 @@ public class ModelCluster {
private Set<Long> modelIds = new LinkedHashSet<>();
private Set<String> modelNames = new LinkedHashSet<>();
private String key;
private String name;
@@ -35,9 +37,10 @@ public class ModelCluster {
}
public void buildName(Map<Long, String> modelNameMap) {
name = modelNameMap.entrySet().stream().filter(entry ->
modelIds.contains(entry.getKey())).map(Map.Entry::getValue)
.collect(Collectors.joining(split));
modelNames = modelNameMap.entrySet().stream().filter(entry ->
modelIds.contains(entry.getKey())).map(Map.Entry::getValue)
.collect(Collectors.toSet());
name = String.join(split, modelNames);
}
public static Set<Long> getModelIdFromKey(String key) {