Downloads · 30 days
38
16% of all-time downloads
AdvRahul/Nova-7B-1M-Q4_K_M
Nova-7B-1M-Q4_K_M is a machine learning model from AdvRahul. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as other.
A safety-enhanced, quantized version of Qwen2.5-7B-Instruct with a massive 1 Million token context window. 🧠
Downloads · 30 days
38
16% of all-time downloads
All-time downloads
239
Public
Repo size
4.7 GB
Likes
0
Public
Click a slice to open those files.
.gguf4.7 GB · 100%
From the Hugging Face model README
A safety-enhanced, quantized version of Qwen2.5-7B-Instruct with a massive 1 Million token context window. 🧠
Nova-7B-1M is a specialized version of the powerful Qwen/Qwen2.5-7B-Instruct-1M model. It has been fine-tuned to improve safety alignment and is provided in the efficient GGUF format, making its incredible long-context capabilities accessible on a wider range of hardware, including CPUs.
Q4_K_M. This 4-bit quantization method offers a great balance between model size, performance, and inference speed.Nova-7B-1M was created with two primary goals:
This model is ideal for tasks involving the analysis, summarization, or querying of extremely long documents, such as entire codebases, legal contracts, or comprehensive research papers, all with an added layer of safety.
This model is in the GGUF format and is intended for use with frameworks like llama.cpp and its Python bindings. The standard transformers library will not work.
llama-cpp-pythonThis is the recommended way to use the model in a Python application.
First, install the library:
# For basic CPU usage
pip install llama-cpp-python
# Or with hardware acceleration (e.g., OpenBLAS)
# CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install --force-reinstall --no-cache-dir llama-cpp-python
from llama_cpp import Llama
# Initialize the Llama model
# You must set n_ctx to your desired context size.
# WARNING: A 1M context window will require a very large amount of RAM (>64GB).
# Adjust n_ctx based on your hardware and needs.
llm = Llama.from_pretrained(
repo_id="AdvRahul/Nova-7B-1M-Q4_K_M-GGUF",
filename="nova-7b-1m-Q4_K_M.gguf", # Or the actual filename
n_ctx=1000000, # <-- CRUCIAL for long context
n_gpu_layers=-1, # Offload all layers to GPU if you have VRAM
verbose=False
)
# Qwen chat template
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Summarize the key points of the provided text."} # Imagine you've loaded a very long document into the prompt
]
# Use the tokenizer from the loaded model to apply the template
prompt = llm.tokenizer().apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Run inference
output = llm(
prompt,
max_tokens=512,
stop=["<|im_end|>"],
echo=False
)
print(output['choices'][0]['text'])
⚠️ Ethical Considerations and Limitations
While this model has been explicitly fine-tuned for safety, no model is perfect.
Safety is Not Guaranteed: The safety alignment is an improvement but does not eliminate all risks. The model may still produce undesirable or biased content.
Long Context Hallucinations: In very long contexts, models can sometimes lose focus or "hallucinate" facts. Always verify critical information from the generated output.
Hardware Demands: While GGUF makes this model more accessible, using the full 1M token context window is extremely RAM-intensive. Users should be aware of the hardware requirements before attempting to process such long sequences.
Developers should always implement their own safety guardrails and content moderation systems as part of a responsible AI deployment strategy.