Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ public void onStats(String stats) {
private void setLocalModel(
String modelPath, String tokenizerPath, String dataPath, float temperature) {
Message modelLoadingMessage = new Message("Loading model...", false, MessageType.SYSTEM, 0);
ETLogging.getInstance().log("Loading model " + modelPath + " with tokenizer " + tokenizerPath);
ETLogging.getInstance()
.log(
"Loading model "
+ modelPath
+ " with tokenizer "
+ tokenizerPath
+ " data path "
+ dataPath);
runOnUiThread(
() -> {
mSendButton.setEnabled(false);
Expand All @@ -145,15 +152,24 @@ private void setLocalModel(

long runStartTime = System.currentTimeMillis();
// Create LlmModule with dataPath
mModule =
new LlmModule(
ModelUtils.getModelCategory(
mCurrentSettingsFields.getModelType(), mCurrentSettingsFields.getBackendType()),
modelPath,
tokenizerPath,
temperature,
dataPath);

if (dataPath.isEmpty()) {
mModule =
new LlmModule(
ModelUtils.getModelCategory(
mCurrentSettingsFields.getModelType(), mCurrentSettingsFields.getBackendType()),
modelPath,
tokenizerPath,
temperature);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LlmModule doesn't handle empty dataPath atm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty string is bad. null should be ok?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but can't tell between null String or null List?

} else {
mModule =
new LlmModule(
ModelUtils.getModelCategory(
mCurrentSettingsFields.getModelType(), mCurrentSettingsFields.getBackendType()),
modelPath,
tokenizerPath,
temperature,
dataPath);
}
int loadResult = mModule.load();
long loadDuration = System.currentTimeMillis() - runStartTime;
String modelLoadError = "";
Expand Down