This file contains hidden or 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 argparse | |
import numpy as np | |
p = 100 # padding token id | |
o = 1 # observation (prompt / input ids) | |
a = 2 # action (response ids) | |
queries = [ | |
[p, p, o, o, o], |
This file contains hidden or 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 torch | |
import torch.nn as nn | |
import torch.optim as optim | |
# Create target distribution (fixed) | |
target_logits = torch.randn(10) | |
target_log_probs = torch.log_softmax(target_logits, dim=0) | |
# Create learnable distribution | |
learnable_logits = nn.Parameter(torch.rand_like(target_logits)) # Initialize randomly |
This file contains hidden or 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
{ | |
"name": "material-ui-nextjs-ts", | |
"version": "5.0.0", | |
"lockfileVersion": 3, | |
"requires": true, | |
"packages": { | |
"": { | |
"name": "material-ui-nextjs-ts", | |
"version": "5.0.0", | |
"dependencies": { |
This file contains hidden or 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
# Taken and modified from https://github.com/huggingface/trl | |
# Copyright 2024 The AllenAI Team. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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 json | |
import os | |
os.environ["HF_HUB_ENABLE_HF_TRANSFER"] = "0" | |
import gradio as gr | |
import numpy as np | |
import pandas as pd | |
from apscheduler.schedulers.background import BackgroundScheduler | |
from huggingface_hub import HfApi, snapshot_download |
This file contains hidden or 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
# coding=utf-8 | |
# Adapted from | |
# https://github.com/huggingface/transformers/blob/v4.40.1/src/transformers/models/olmo/modeling_olmo.py | |
# Copyright 2024 The vLLM team. | |
# Copyright 2024 EleutherAI and the HuggingFace Inc. team. All rights reserved. | |
# | |
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX | |
# and OPT implementations in this library. It has been modified from its | |
# original forms to accommodate minor architectural differences compared | |
# to GPT-NeoX and OPT used by the Meta AI team that trained the model. |
This file contains hidden or 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
python scripts/submit_finetune_job.py \ | |
--cluster ai2/augusta-google-1 \ | |
--priority high \ | |
--workspace ai2/tulu-3-dev \ | |
--num_nodes 4 \ | |
--image costah/open_instruct_ppo_ray_ninja \ | |
--default_beaker_config configs/beaker_configs/default_finetune_multinode.yaml \ | |
--config configs/train_configs/sft/tulu3_8b_preview_mix_v3.9.yaml \ | |
--exp_name olmo1124_finetune |
This file contains hidden or 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
# coding=utf-8 | |
# Adapted from | |
# https://github.com/huggingface/transformers/blob/v4.40.1/src/transformers/models/olmo/modeling_olmo.py | |
# Copyright 2024 The vLLM team. | |
# Copyright 2024 EleutherAI and the HuggingFace Inc. team. All rights reserved. | |
# | |
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX | |
# and OPT implementations in this library. It has been modified from its | |
# original forms to accommodate minor architectural differences compared | |
# to GPT-NeoX and OPT used by the Meta AI team that trained the model. |
This file contains hidden or 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
# coding=utf-8 | |
# Adapted from | |
# https://github.com/huggingface/transformers/blob/v4.40.1/src/transformers/models/olmo/modeling_olmo.py | |
# Copyright 2024 The vLLM team. | |
# Copyright 2024 EleutherAI and the HuggingFace Inc. team. All rights reserved. | |
# | |
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX | |
# and OPT implementations in this library. It has been modified from its | |
# original forms to accommodate minor architectural differences compared | |
# to GPT-NeoX and OPT used by the Meta AI team that trained the model. |
This file contains hidden or 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
""" | |
DROP: | |
python compare_eval.py --exp_ids 01JC3JT8TQW6GZ1CXA7N624GJN 01JBJ5V6BBT8Q1741T79CGRN50 | |
GSM8K: | |
python compare_eval.py --exp_ids 01JC3JT7VKJ0WR1P5TT3EEBD15 01JBJ2WFVXJAGQC8Q2R5AFR39Z | |
alpaca eval: | |
python compare_eval.py --exp_ids 01JC3JTCFBCRKTSGV7A5RXWZVM 01JBJ5V9RHFWY9TX4PZFD5G24H | |
""" | |
import copy |