From d6c582ef0e585869f0bcb1790d302683ebfd8097 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 27 Mar 2026 05:48:18 -0300 Subject: through divine intervention it was revealed to me a couple of critical bugs and with the help of Claude + an updated model I've finally achieved faster and smarter responses --- main.py | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'main.py') diff --git a/main.py b/main.py index 7baa30b..c489b21 100644 --- a/main.py +++ b/main.py @@ -1,20 +1,15 @@ #!/usr/bin/env python3 import asyncio import json +import re # thank you claude import ollama import websockets from websockets.server import serve from datetime import datetime -chatmodel = "hf.co/Orenguteng/Llama-3.1-8B-Lexi-Uncensored-V2-GGUF:Llama-3.1-8B-Lexi-Uncensored_V2_Q4.gguf" +chatmodel = "hf.co/Stetsoncody/Llama-3.2-3B-Instruct-abliterated-GGUF:Q4_K_M" embedmodel = 'hf.co/CompendiumLabs/bge-base-en-v1.5-gguf' -# these are test models just ignore -#chatmodel = 'hf.co/bartowski/Llama-3.2-1B-Instruct-GGUF' -#chatmodel = 'hf.co/VibeStudio/Nidum-Llama-3.2-3B-Uncensored-GGUF' -#chatmodel = "faggotchan" -#chatmodel = "qwen3.5:4b" - NUM_THREADS = 6 # hardcoded since threads.txt is gone, change if needed def times() -> str: @@ -160,16 +155,17 @@ async def ollamachat(websocket): model=chatmodel, messages=messages, options={ - "temperature": 0.8, - "top_p": 0.9, + "temperature": 0.83, + "top_p": 0.9 "top_k": 40, "repeat_penalty": 1.1, - "num_predict": 4096, + "num_predict": 1024, "num_thread": NUM_THREADS, } ) - bot_reply = response["message"]["content"].strip() + # strip blocks in case the model ignores think=False, thank you claude + bot_reply = re.sub(r'.*?', '', response["message"]["content"], flags=re.DOTALL).strip() print(messages) print(f"[{times()}] reply: {bot_reply}\n") -- cgit v1.3-2-g0d8e