Hermes SIQ-1-35B on ZeroGPU (llama-cpp-python recipe)
Browse files55 unmodified lines56575859606162733 unmodified lines79679779879980080180280380480580680780880955 unmodified linesGGUF_FILE = os.environ.get("GGUF_FILE", "gguf/SIQ-1-35B.Q4_K_M.gguf")N_CTX = int(os.environ.get("N_CTX", "16384")) # keep cold-start init lightprint("=== APP BUILD MARKER: chunkfix-v3 ===", flush=True)print("Downloading GGUF from the Hub ...", flush=True)MODEL_PATH = hf_hub_download(GGUF_REPO, GGUF_FILE)print("GGUF ready at", MODEL_PATH, flush=True)733 unmodified linesanswer = raw = thinking = tools = doc = ""doc_name = "artifact.html"in_tok = out_tok = 0for answer, raw, thinking, tools, doc, doc_name, in_tok, out_tok in _agent_stream(message, prior, system_prompt, temperature, max_tokens, use_tools):history[-1]["content"] = _chat_message(answer, thinking, tools, streaming=True, in_tok=in_tok, out_tok=out_tok)prev = _BUILDING_PREVIEW if doc else _EMPTY_PREVIEWyield history, "", raw, (thinking or _NO_REASONING), doc, prev, (tools or _NO_TOOLS), metahistory[-1]["content"] = _chat_message(answer, thinking, tools, streaming=False)meta = meta + [{"turn_id": uuid.uuid4().hex, "user": message, "answer": answer,55 unmodified lines56575859606162733 unmodified lines79679779879980080180280380480580680780880981081181281381481581655 unmodified linesGGUF_FILE = os.environ.get("GGUF_FILE", "gguf/SIQ-1-35B.Q4_K_M.gguf")N_CTX = int(os.environ.get("N_CTX", "16384")) # keep cold-start init lightprint("=== APP BUILD MARKER: chunkfix-v4 ===", flush=True)print("Downloading GGUF from the Hub ...", flush=True)MODEL_PATH = hf_hub_download(GGUF_REPO, GGUF_FILE)print("GGUF ready at", MODEL_PATH, flush=True)733 unmodified linesanswer = raw = thinking = tools = doc = ""doc_name = "artifact.html"in_tok = out_tok = 0try:for answer, raw, thinking, tools, doc, doc_name, in_tok, out_tok in _agent_stream(message, prior, system_prompt, temperature, max_tokens, use_tools):history[-1]["content"] = _chat_message(answer, thinking, tools, streaming=True, in_tok=in_tok, out_tok=out_tok)prev = _BUILDING_PREVIEW if doc else _EMPTY_PREVIEWyield history, "", raw, (thinking or _NO_REASONING), doc, prev, (tools or _NO_TOOLS), metaexcept Exception:import tracebacktb = traceback.format_exc()history[-1]["content"] = f"⚠️ **generation crashed**\n\n```\n{tb[-1800:]}\n```"yield history, "", tb, (thinking or _NO_REASONING), doc, _EMPTY_PREVIEW, (tools or _NO_TOOLS), metareturnhistory[-1]["content"] = _chat_message(answer, thinking, tools, streaming=False)meta = meta + [{"turn_id": uuid.uuid4().hex, "user": message, "answer": answer,
app.py+16-9