Downloads · 30 days
7
3% of all-time downloads
frankmorales2020/deepseek-governed-no-amnesia
deepseek-governed-no-amnesia is a text generation model from frankmorales2020. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
CODE: https://github.com/frank-morales2020/AST/blob/main/DEEPSEEKPRIMEANCHORELLM.ipynb
Downloads · 30 days
7
3% of all-time downloads
All-time downloads
222
Public
Parameters
7.6B
16.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors15.2 GB · 93%
From the Hugging Face model README
CODE: https://github.com/frank-morales2020/AST/blob/main/DEEPSEEK_PRIME_ANCHORE_LLM.ipynb
An experimental repository pairing DeepSeek-R1-Distill-Qwen-7B with a "Prime-Anchored Spectral Governor" artifact. This card describes exactly what the repository contains and what the accompanying run did and did not do.
deepseek-ai/DeepSeek-R1-Distill-Qwen-7B.
The governor did not modify them.governor_state.pt, which records the governor configuration
(anchor primes, threshold, cached anchor rows, gate statistics, and a
SHA-256 signature of the prime-indexed embedding rows).VERIFICATION.txt records the run details.The governor evaluates a gate on each training step and pins six
prime-indexed embedding rows ([2, 3, 5, 7, 11, 13]) to their original
values. In the run that produced this repository, the optimizer step was a
no-op (STEP_GATED_NO_MUTATION), so the model was not trained or
fine-tuned.
As a result:
Research and experimentation with the governor tooling. For general use, loading the base model directly is equivalent and avoids downloading a duplicate copy of the weights.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
REPO_ID = "frankmorales2020/deepseek-governed-no-amnesia"
tokenizer = AutoTokenizer.from_pretrained(REPO_ID, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
REPO_ID, torch_dtype=torch.float16, device_map="auto", trust_remote_code=True
)
model.eval()
prompt = "Explain why prime numbers are important in cryptography."
text = tokenizer.apply_chat_template(
[{"role": "user", "content": prompt}],
tokenize=False, add_generation_prompt=True,
)
enc = tokenizer(text, return_tensors="pt").to(model.device)
out = model.generate(
**enc,
max_new_tokens=512,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.3,
no_repeat_ngram_size=3,
pad_token_id=tokenizer.eos_token_id,
)
print(tokenizer.decode(out[0][enc["input_ids"].shape[1]:], skip_special_tokens=True))
This is a DeepSeek R1 distill (reasoning) model. Feed prompts through the chat template, and expect a
<think> ... </think>reasoning trace before the final answer. To keep only the final answer, split the output on</think>.
from huggingface_hub import hf_hub_download
import torch
state = torch.load(
hf_hub_download(REPO_ID, "governor_state.pt"),
map_location="cpu", weights_only=False,
)
print(state["primes"], state["LAMBDA_12"], state["anchor_signature"], state["stats"])
Released under the MIT license, inherited from the base model.
Base model: DeepSeek-R1-Distill-Qwen-7B by DeepSeek-AI.