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
data = [{'content': 'The wages earned by Robin is 30% more than that earned by Erica. The wages earned by Charles is 60% more than that earned by Erica. How much percent is the wages earned by Charles more than that earned by Robin?', 'role': 'user'}, {'content': "Let's assume Erica earns a wage of $E.\n\nRobin earns 30% more than Erica, so Robin's wage is:\nRobin's wage = E + 30% of E\nRobin's wage = E + 0.30E\nRobin's wage = 1.30E\n\nCharles earns 60% more than Erica, so Charles's wage is:\nCharles's wage = E + 60% of E\nCharles's wage = E + 0.60E\nCharles's wage = 1.60E\n\nNow, we want to find out how much percent the wages earned by Charles is more than that earned by Robin. To do this, we calculate the difference between Charles's and Robin's wages and then find out what percentage this difference is of Robin's wages.\n\nDifference in wages = Charles's wage - Robin's wage\nDifference in wages = 1.60E - 1.30E\nDifference in wages = 0.30E\n\nNow, we find out what percentage this difference is of Robin's wa |
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
# flake8: noqa | |
# Copyright 2023 The HuggingFace Inc. 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 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 collections import defaultdict | |
import numpy as np | |
import pandas as pd | |
import torch | |
import torch.nn as nn | |
from datasets import load_dataset | |
from rich.console import Console | |
from rich.table import Table | |
from transformers import ( |
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 numpy as np | |
import torch | |
import torch.nn as nn | |
from transformers import ( | |
AutoConfig, | |
AutoModel, | |
PretrainedConfig, | |
PreTrainedModel, | |
) |
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 collections import defaultdict | |
import numpy as np | |
import pandas as pd | |
import torch | |
import torch.nn as nn | |
from datasets import load_dataset | |
from rich.console import Console | |
from rich.table import Table | |
from transformers import ( | |
AutoTokenizer, |
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 collections import defaultdict | |
import numpy as np | |
import pandas as pd | |
import torch | |
import torch.nn as nn | |
from datasets import load_dataset | |
from rich.console import Console | |
from rich.table import Table | |
from transformers import ( | |
AutoTokenizer, |
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 datasets import load_dataset | |
import numpy as np | |
import pandas as pd | |
from rich.console import Console | |
from rich.table import Table | |
console = Console() | |
ds = load_dataset("HuggingFaceH4/OpenHermesPreferences", split="train") | |
idxs = np.random.choice(len(ds), 1000, replace=False) | |
ds = ds.select(idxs) |
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 collections import defaultdict | |
import random | |
from huggingface_hub import hf_hub_download | |
from datasets import Dataset | |
import numpy as np | |
import pandas as pd | |
from transformers import AutoTokenizer | |
from rich.console import Console | |
from rich.table import Table | |
from trl import DPOTrainer |
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
""" | |
git clone https://github.com/argilla-io/distilabel.git | |
pip install -e ".[hf-inference-endpoints]" | |
""" | |
import asyncio | |
import os | |
import pandas as pd | |
from llm_swarm import LLMSwarm, LLMSwarmConfig | |
from huggingface_hub import AsyncInferenceClient |
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 collections import defaultdict | |
import numpy as np | |
import pandas as pd | |
import torch | |
import torch.nn as nn | |
from datasets import load_dataset | |
from rich.console import Console | |
from rich.table import Table | |
from transformers import ( | |
AutoConfig, |
NewerOlder