-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved runtime storage, and other stuff (#110)
* Separate filename from path * Revise plugins global * remove extraneous info logs * Cleanup logs * Remove support for wasm in local build dir * misc * refactoring * Reimplement list/load functions * AWS failure should be fatal now * filename, not path * Cleanup path vs filepath * Implement storage monitor * Don't block http startup * Remove manual reload, and noreload option * Move appdata files to new package * Add some error handling * Monitor app data files for changes * Refactoring * Update readme and launch profiles * Fix nil pointer dereference * Fix AWS initialization error handling
- Loading branch information
1 parent
c247bbf
commit 8b0fbda
Showing
25 changed files
with
763 additions
and
1,099 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright 2024 Hypermode, Inc. | ||
*/ | ||
|
||
package appdata | ||
|
||
var appDataFiles = map[string]AppData{ | ||
"hypermode.json": &HypermodeData, | ||
"models.json": &ModelData, | ||
} | ||
|
||
var HypermodeData HypermodeAppData = HypermodeAppData{} | ||
var ModelData ModelsAppData = ModelsAppData{} | ||
|
||
type AppData any | ||
|
||
type HypermodeAppData struct { | ||
Models []Model `json:"models"` | ||
EmbeddingSpecs []EmbeddingSpec `json:"embeddingSpecs"` | ||
TrainingInstructions []TrainingInstruction `json:"trainingInstructions"` | ||
AppData | ||
} | ||
|
||
type ModelsAppData struct { | ||
AppData | ||
} | ||
|
||
type ModelTask string | ||
|
||
const ( | ||
ClassificationTask ModelTask = "classification" | ||
EmbeddingTask ModelTask = "embedding" | ||
GeneratorTask ModelTask = "generator" | ||
) | ||
|
||
type Model struct { | ||
Name string `json:"name"` | ||
Task ModelTask `json:"task"` | ||
SourceModel string `json:"sourceModel"` | ||
Provider string `json:"provider"` | ||
Host string `json:"host"` | ||
Endpoint string `json:"endpoint"` | ||
AuthHeader string `json:"authHeader"` | ||
} | ||
|
||
type EmbeddingSpec struct { | ||
EntityType string `json:"entityType"` | ||
Attribute string `json:"attribute"` | ||
ModelName string `json:"modelName"` | ||
Config struct { | ||
Query string `json:"query"` | ||
Template string `json:"template"` | ||
} `json:"config"` | ||
} | ||
|
||
type TrainingInstruction struct { | ||
ModelName string `json:"modelName"` | ||
Labels []string `json:"labels"` | ||
} |
Oops, something went wrong.