diff options
| author | david <[email protected]> | 2026-03-31 15:10:02 -0300 |
|---|---|---|
| committer | david <[email protected]> | 2026-03-31 15:10:02 -0300 |
| commit | 6004eadd61c4f53c041b683e684449e3f910d4bf (patch) | |
| tree | 97ed15182b0bfae893ea74ce1db2fc5e049de80b /main.py | |
| parent | 6271325fdee9e0ec234582469ac52f84922fecb6 (diff) | |
| download | faggot-chan-6004eadd61c4f53c041b683e684449e3f910d4bf.tar.gz faggot-chan-6004eadd61c4f53c041b683e684449e3f910d4bf.zip | |
made it so it reads the system prompt and parameters from a file (this was vibecoded but it works so it's okay)
Diffstat (limited to 'main.py')
| -rw-r--r-- | main.py | 13 |
1 files changed, 4 insertions, 9 deletions
@@ -4,13 +4,13 @@ import json import re # thank you claude import ollama import websockets +from pathlib import Path from websockets.server import serve from datetime import datetime chatmodel = "hf.co/Stetsoncody/Llama-3.2-3B-Instruct-abliterated-GGUF:Q4_K_M" embedmodel = 'hf.co/CompendiumLabs/bge-base-en-v1.5-gguf' -NUM_THREADS = 6 # hardcoded since threads.txt is gone, change if needed def times() -> str: return datetime.now().strftime("%Y-%m-%d %H:%M:%S") @@ -151,17 +151,12 @@ async def ollamachat(websocket): messages.insert(0, {"role": "system", "content": system_prompt + rag_block}) + params = json.loads(Path("config/params.json").read_text()) + response = ollama.chat( model=chatmodel, messages=messages, - options={ - "temperature": 0.83, - "top_p": 0.9, - "top_k": 40, - "repeat_penalty": 1.1, - "num_predict": 1024, - "num_thread": NUM_THREADS, - } + options=params, ) # strip <think> blocks in case the model ignores think=False, thank you claude |
