Downloads · 30 days
22
3% of all-time downloads
prithivMLmods/Megatron-Opus-7B-Exp
Megatron-Opus-7B-Exp is a text generation model from prithivMLmods. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as llama3.1.
Downloads · 30 days
22
3% of all-time downloads
All-time downloads
644
Public
Parameters
7.5B
14.9 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors14.9 GB · 100%
From the Hugging Face model README

Megatron-Opus-7B-Exp is based on the Qwen 2.5 7B modality architecture, designed to enhance the reasoning capabilities of 7B-parameter models. It has been fine-tuned on a Synthetic dataset entries based on one half of Qwen’s QWQ and DeepSeek R1, further optimizing its chain-of-thought (CoT) reasoning and logical problem-solving abilities. The model demonstrates significant improvements in context understanding, structured data processing, and long-context comprehension, making it ideal for complex reasoning tasks, instruction-following, and text generation.
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "prithivMLmods/Megatron-Opus-7B-Exp"
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
prompt = "Explain the concept of logical reasoning in AI."
messages = [
{"role": "system", "content": "You are an expert AI assistant specialized in reasoning and logic."},
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)