Reasoning Models
Collection
Chain of Thought • 11 items • Updated • 2
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("khazarai/Scie-R1")
model = AutoModelForCausalLM.from_pretrained("khazarai/Scie-R1")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))This fine-tuned model is designed for:
It is not intended to replace human researchers, perform advanced analytics, or generate novel scientific discoveries.
Use the code below to get started with the model.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("khazarai/Scie-R1")
model = AutoModelForCausalLM.from_pretrained(
"khazarai/Scie-R1",
device_map={"": 0}
)
question = """
How are microfluidic devices revolutionizing laboratory analysis techniques, and what are the primary advantages they offer over traditional methods?
"""
messages = [
{"role" : "user", "content" : question}
]
text = tokenizer.apply_chat_template(
messages,
tokenize = False,
add_generation_prompt = True,
enable_thinking = True,
)
from transformers import TextStreamer
_ = model.generate(
**tokenizer(text, return_tensors = "pt").to("cuda"),
max_new_tokens = 1800,
temperature = 0.6,
top_p = 0.95,
top_k = 20,
streamer = TextStreamer(tokenizer, skip_prompt = True),
)
Scope
This model was fine-tuned on tasks that involve core scientific reasoning:
Illustrative Examples
Emphasis on Chain-of-Thought (CoT)
Focus on Foundational Knowledge
The dataset aims to strengthen models in foundational scientific reasoning skills rather than covering all domains of scientific knowledge.
Dataset: moremilk/CoT_Reasoning_Scientific_Discovery_and_Research
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khazarai/Scie-R1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)