Downloads · 30 days
13
33% of all-time downloads
jahidhasan/os_reasoning_model-v2
os_reasoning_model-v2 is a machine learning model from jahidhasan. 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 apache-2.0.
It is a updated version of Operating Systems reasoning model, fine-tuned from microsoft/DialoGPT-medium specifically for educational purposes for Operating Systems course. The model can helps:
Downloads · 30 days
13
33% of all-time downloads
All-time downloads
40
Public
Parameters
355M
2.1 GB on disk
Likes
2
Public
Click a slice to open those files.
.pt1.4 GB · 50%
From the Hugging Face model README
It is a updated version of Operating Systems reasoning model, fine-tuned from microsoft/DialoGPT-medium specifically for educational purposes for Operating Systems course. The model can helps:
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load model and tokenizer
model_name = "jahidhasan/os_reasoning_model-v2"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True
)
def ask_os_question(question):
prompt = f'''<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are an expert in Operating Systems. Provide clear, step-by-step reasoning for OS concepts and problems.
<|eot_id|><|start_header_id|>user<|end_header_id|>
{question}
<|eot_id|><|start_header_id|>assistant<|end_header_id|>
'''
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=500,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.1
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
# Extract assistant response
assistant_start = response.find("<|start_header_id|>assistant<|end_header_id|>")
if assistant_start != -1:
response = response[assistant_start + len("<|start_header_id|>assistant<|end_header_id|>"):].strip()
return response
# Example usage
question = "What is a deadlock in operating systems and how can it be prevented?"
answer = ask_os_question(question)
print(answer)
Question: "What is virtual memory in operating systems?"
Response:
Let me explain virtual memory step by step:
Step 1: Definition and Context
Virtual memory is a memory management technique that provides an abstraction layer between the physical memory and the processes running on the system.
Step 2: How it Works
The mechanism involves mapping virtual addresses to physical addresses through page tables, allowing processes to have their own virtual address space that may be larger than physical RAM.
Step 3: Why it's Important
This is crucial because it enables memory isolation between processes, allows efficient memory utilization, and provides the illusion of unlimited memory to applications.
Step 4: Practical Example
In practice, when a process accesses a virtual address, the Memory Management Unit (MMU) translates it to a physical address, handling page faults when data needs to be loaded from storage.
Therefore, virtual memory is a fundamental abstraction that plays a vital role in modern operating system memory management.
All training data respects copyright and fair use guidelines.
We welcome contributions to improve the model:
If you use this model in your research or educational work, please cite:
@misc{os-reasoning-model-v2,
author = {Jahid Hasan},
title = {Operating System Reasoning Model v2.0},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/jahidhasan/os_reasoning_model-v2},
note = {Fine-tuned from microsoft/DialoGPT-medium}
}
Trained with ❤️ for Operating Systems Education