Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import AutoModelForCausalLM, AutoTokenizer | |
from datasets import load_dataset | |
from random import randint | |
# Load model and tokenizer | |
model_id = "philschmid/qwen-2.5-3b-r1-countdown" | |
model = AutoModelForCausalLM.from_pretrained(model_id) | |
tokenizer = AutoTokenizer.from_pretrained(model_id) | |
# Load dataset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import AutoTokenizer, AutoModelForCausalLM | |
from datasets import load_dataset | |
import re | |
from trl import GRPOConfig, GRPOTrainer | |
from peft import LoraConfig, TaskType | |
import torch | |
# Dataset and Tokenizer Setup | |
dataset_id = "Jiayi-Pan/Countdown-Tasks-3to4" | |
dataset = load_dataset(dataset_id, split="train") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Pytorch & other libraries, make sure to match your GPU driver version | |
%pip install "torch==2.5.1" tensorboard "setuptools<71.0.0" --index-url https://download.pytorch.org/whl/cu121 | |
# Install flash-attn | |
%pip install flash-attn | |
# Install Hugging Face libraries | |
%pip install --upgrade \ | |
"transformers==4.48.1" \ | |
"datasets==3.1.0" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import os | |
from dataclasses import dataclass | |
from datetime import datetime | |
import logging | |
import os | |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "1" | |
import random | |
import re | |
import torch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import logging | |
import time | |
import traceback | |
import gc | |
import functools | |
from typing import Optional, List, Tuple | |
from dataclasses import dataclass | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import logging | |
import time | |
import traceback | |
import gc | |
import functools | |
from typing import Optional, List, Tuple | |
from dataclasses import dataclass | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import logging | |
import time | |
import traceback | |
import gc | |
import functools | |
from typing import Optional, List, Tuple | |
from dataclasses import dataclass | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import logging | |
import time | |
import traceback | |
import gc | |
import functools | |
from typing import Optional, List, Tuple | |
from dataclasses import dataclass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> why did the chinese man stop the tank | |
<think> | |
Okay, so I came across this question: "Why did the Chinese man stop the tank?" At first glance, it seems like a historical reference because of | |
the mention of tanks. Maybe it's about some event in China involving tanks and civilians. | |
I remember hearing something about the Tiananmen Square protests in 1989, where there were massive demonstrations in Beijing, and the | |
government responded with military force. There was this iconic image of a man standing in front of a column of tanks, which became a symbol of | |
resistance and courage. | |
So, perhaps that's what the question is referring to. The Chinese man stopping the tank could be about that moment when one individual stood up |
NewerOlder