mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 11:07:06 +00:00
(improvement)(chat) Add model name set in ModelCluster (#449)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -4,8 +4,7 @@ public enum CostType {
|
|||||||
MAPPER(1, "mapper"),
|
MAPPER(1, "mapper"),
|
||||||
PARSER(2, "parser"),
|
PARSER(2, "parser"),
|
||||||
QUERY(3, "query"),
|
QUERY(3, "query"),
|
||||||
PARSERRESPONDER(4, "responder"),
|
PROCESSOR(4, "processor");
|
||||||
PROCESSOR(5, "processor");
|
|
||||||
|
|
||||||
private Integer type;
|
private Integer type;
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ public class ModelCluster {
|
|||||||
|
|
||||||
private Set<Long> modelIds = new LinkedHashSet<>();
|
private Set<Long> modelIds = new LinkedHashSet<>();
|
||||||
|
|
||||||
|
private Set<String> modelNames = new LinkedHashSet<>();
|
||||||
|
|
||||||
private String key;
|
private String key;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
@@ -35,9 +37,10 @@ public class ModelCluster {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void buildName(Map<Long, String> modelNameMap) {
|
public void buildName(Map<Long, String> modelNameMap) {
|
||||||
name = modelNameMap.entrySet().stream().filter(entry ->
|
modelNames = modelNameMap.entrySet().stream().filter(entry ->
|
||||||
modelIds.contains(entry.getKey())).map(Map.Entry::getValue)
|
modelIds.contains(entry.getKey())).map(Map.Entry::getValue)
|
||||||
.collect(Collectors.joining(split));
|
.collect(Collectors.toSet());
|
||||||
|
name = String.join(split, modelNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Set<Long> getModelIdFromKey(String key) {
|
public static Set<Long> getModelIdFromKey(String key) {
|
||||||
|
|||||||
Reference in New Issue
Block a user