Skip to content

Commit 9fc32b1

Browse files
authored
Add Model type toString() (#85)
1 parent d53053c commit 9fc32b1

File tree

1 file changed

+14
-1
lines changed
  • llm/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo

1 file changed

+14
-1
lines changed

llm/android/LlamaDemo/app/src/main/java/com/example/executorchllamademo/ModelType.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,18 @@ public enum ModelType {
1414
LLAVA_1_5,
1515
LLAMA_GUARD_3,
1616
QWEN_3,
17-
VOXTRAL,
17+
VOXTRAL;
18+
19+
@Override
20+
public String toString() {
21+
// Replace underscores with spaces, capitalize words, and handle special cases
22+
String pretty = name().replace('_', ' ').toLowerCase();
23+
// Capitalize the first letter if needed
24+
if (!pretty.isEmpty()) {
25+
pretty = pretty.substring(0, 1).toUpperCase() + pretty.substring(1);
26+
}
27+
// Optionally, handle special capitalization
28+
pretty = pretty.replace("Llava 1 5", "LLaVA 1.5");
29+
return pretty;
30+
}
1831
}

0 commit comments

Comments
 (0)