Skip to content

Commit

Permalink
Push works
Browse files Browse the repository at this point in the history
  • Loading branch information
cheroliv committed Sep 25, 2024
1 parent ca19a4a commit a220577
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
12 changes: 12 additions & 0 deletions buildSrc/src/main/kotlin/school/ai/AssistantManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,20 @@ import org.slf4j.LoggerFactory


object AssistantManager {

val logger = LoggerFactory.getLogger(AssistantPlugin::class.java)

@JvmStatic
val Project.localModels
get() = mapOf(
"llama3.2:3b" to "LlamaTiny",
"llama3.1:8b" to "LlamaSmall",
"mistral:7b" to "Mistral",
"phi3.5:3.8b" to "Phi",
"smollm:135m" to "SmollM",
)

@JvmStatic
val Project.apiKey: String
get() = Properties().apply {
"$projectDir/private.properties"
Expand Down
8 changes: 2 additions & 6 deletions buildSrc/src/main/kotlin/school/ai/AssistantPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import school.ai.AssistantManager.apiKey
import school.ai.AssistantManager.createOllamaChatModel
import school.ai.AssistantManager.createOllamaStreamingChatModel
import school.ai.AssistantManager.generateStreamingResponse
import school.ai.AssistantManager.localModels
import school.ai.AssistantManager.userMessage

class AssistantPlugin : Plugin<Project> {
Expand Down Expand Up @@ -74,12 +75,7 @@ class AssistantPlugin : Plugin<Project> {
}

// Creating tasks for each model
mapOf(
"llama3.1:latest" to "Llama3",
"mistral" to "Mistral",
"phi3.5:latest" to "Phi",
"smollm:135m" to "SmollM",
).forEach { model ->
localModels.forEach { model ->
createChatTask("helloOllama${model.value}", model.key)
createStreamingChatTask("helloOllamaStream${model.value}", model.key)
}
Expand Down
2 changes: 2 additions & 0 deletions buildSrc/src/main/kotlin/school/ai/datas.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package school.ai

0 comments on commit a220577

Please sign in to comment.