mirror of
https://github.com/SpudGunMan/meshing-around.git
synced 2026-07-03 08:21:40 +02:00
model to settings for LLM
This commit is contained in:
@@ -38,6 +38,8 @@ spaceWeather = True
|
||||
wikipedia = True
|
||||
# Enable ollama LLM see more at https://ollama.com
|
||||
ollama = False
|
||||
# Ollama modul
|
||||
ollamaModel = 'llama3.1'
|
||||
# StoreForward Enabled and Limits
|
||||
StoreForward = True
|
||||
StoreLimit = 3
|
||||
|
||||
+3
-3
@@ -6,7 +6,7 @@ from langchain_ollama import OllamaLLM
|
||||
from langchain_core.prompts import ChatPromptTemplate
|
||||
|
||||
meshBotAI = """
|
||||
FROM llama3.1
|
||||
FROM {llmModel}
|
||||
SYSTEM
|
||||
You must keep responses under 450 characters at all times, the response will be cut off if it exceeds this limit.
|
||||
You must respond in plain text standard ASCII characters, or emojis.
|
||||
@@ -19,7 +19,7 @@ PROMPT
|
||||
"""
|
||||
# LLM System Variables
|
||||
#ollama_model = OllamaLLM(model="phi3")
|
||||
ollama_model = OllamaLLM(model="llama3.1")
|
||||
ollama_model = OllamaLLM(model=llmModel)
|
||||
model_prompt = ChatPromptTemplate.from_template(meshBotAI)
|
||||
chain_prompt_model = model_prompt | ollama_model
|
||||
antiFloodLLM = []
|
||||
@@ -41,7 +41,7 @@ def llm_query(input, nodeID=0):
|
||||
response = ""
|
||||
logger.debug(f"System: LLM Query: {input} From:{nodeID}")
|
||||
|
||||
result = chain_prompt_model.invoke({"input": input})
|
||||
result = chain_prompt_model.invoke({"input": input, "llmModel": llmModel})
|
||||
#logger.debug(f"System: LLM Response: " + result.strip().replace('\n', ' '))
|
||||
response = result.strip().replace('\n', ' ')
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ try:
|
||||
solar_conditions_enabled = config['general'].getboolean('spaceWeather', True)
|
||||
wikipedia_enabled = config['general'].getboolean('wikipedia', False)
|
||||
llm_enabled = config['general'].getboolean('ollama', False) # https://ollama.com
|
||||
llmModel = config['general'].get('ollamaModel', 'llama3.1') # default llama3.1
|
||||
|
||||
sentry_enabled = config['sentry'].getboolean('SentryEnabled', False) # default False
|
||||
secure_channel = config['sentry'].getint('SentryChannel', 2) # default 2
|
||||
|
||||
Reference in New Issue
Block a user