Dataset Viewer
Auto-converted to Parquet Duplicate
prompt
stringlengths
280
106k
metadata
dict
anchor_name
stringlengths
19
95
anchor_text
dict
dependencies
dict
import_statements
sequencelengths
0
48
top
listlengths
1
9
⌀
You are a Python programmer working with a repository. Here is all the context you may find useful to complete the function: #FILE trlx/data/ppo_types.py class PPORLElement: """ :param query_tensor: The query tensor i.e. the prompt tokens. Should be a long tensor. :type query_tensor...
{ "context_start_lineno": 0, "fpath_tuple": [ "CarperAI_trlx", "trlx", "pipeline", "__init__.py" ], "function_name": "register_datapipeline", "ground_truth": " def register_class(cls, name):\n _DATAPIPELINE[name] = cls\n setattr(sys.modules[__name__], name, cls)\n retur...
register_datapipeline@trlx/pipeline/__init__.py
{ "description": "Decorator used register a CARP architecture\nArgs:\n name: Name of the architecture", "file_path": "trlx/pipeline/__init__.py", "name": "register_datapipeline", "signature": "def register_datapipeline(name):" }
{ "negative": { "classes": [ { "base_classes": [ "Dataset" ], "code": "class BasePipeline(Dataset):\n def __init__(self, path: str = \"dataset\"):\n super().__init__()\n\n @abstractmethod\n def __getitem__(self, index: int) -> GeneralElement:\n pass\n...
[ "from trlx.data import GeneralElement", "from trlx.data import RLElement", "import random", "from abc import abstractmethod", "from abc import abstractstaticmethod", "from torch.utils.data import DataLoader", "from torch.utils.data import Dataset", "from typing import Any", "from typing import Calla...
[ { "content": [ "class PPORLElement:\n \"\"\"\n :param query_tensor: The query tensor i.e. the prompt tokens.\n Should be a long tensor.\n :type query_tensor: torch.Tensor\n\n :param response_tensor: The response tensor i.e. the output tokens.\n ...
You are a Python programmer working with a repository. Here is all the context you may find useful to complete the function: #FILE trlx/data/__init__.py class GeneralElement: """ General element outputted by a data pipeline """ pass class RLElement: """ Batch element for RL model """ s...
{ "context_start_lineno": 0, "fpath_tuple": [ "CarperAI_trlx", "trlx", "pipeline", "__init__.py" ], "function_name": "register_class", "ground_truth": " _DATAPIPELINE[name] = cls\n setattr(sys.modules[__name__], name, cls)\n return cls\n", "lineno": 20, "task_id": "Car...
register_class@trlx/pipeline/__init__.py
{ "description": "DOCSTRING", "file_path": "trlx/pipeline/__init__.py", "name": "register_datapipeline.register_class", "signature": "def register_class(cls, name):" }
{ "negative": { "classes": [ { "base_classes": [ "Dataset" ], "code": "class BasePipeline(Dataset):\n def __init__(self, path: str = \"dataset\"):\n super().__init__()\n\n @abstractmethod\n def __getitem__(self, index: int) -> GeneralElement:\n pass\n...
[ "from trlx.data import GeneralElement", "from trlx.data import RLElement", "import random", "from abc import abstractmethod", "from abc import abstractstaticmethod", "from torch.utils.data import DataLoader", "from torch.utils.data import Dataset", "from typing import Any", "from typing import Calla...
[ { "content": [ "def register_class(cls, name):\n _DATAPIPELINE[name] = cls\n setattr(sys.modules[__name__], name, cls)\n return cls", "def register_datapipeline(name):\n \"\"\"Decorator used register a CARP architecture\n Args:\n name: Name of the architecture\n ...
You are a Python programmer working with a repository. Here is all the context you may find useful to complete the function: #FILE trlx/data/method_configs.py class MethodConfig: """ Config for a certain RL method. :param name: Name of the method :type name: str """ name: str @classmethod...
{ "context_start_lineno": 0, "fpath_tuple": [ "CarperAI_trlx", "trlx", "data", "configs.py" ], "function_name": "load_yaml", "ground_truth": " with open(yml_fp, mode=\"r\") as file:\n config = yaml.safe_load(file)\n return cls.from_dict(config)\n", "lineno": 234, "...
load_yaml@trlx/data/configs.py
{ "description": "Load yaml file as TRLConfig.\n\n:param yml_fp: Path to yaml file\n:type yml_fp: str", "file_path": "trlx/data/configs.py", "name": "TRLConfig.load_yaml", "signature": "def load_yaml(cls, yml_fp: str):" }
{ "negative": { "classes": [ { "base_classes": [], "code": "class MethodConfig:\n \"\"\"\n Config for a certain RL method.\n\n :param name: Name of the method\n :type name: str\n \"\"\"\n\n name: str\n\n @classmethod\n def from_dict(cls, config: Dict[str, Any]):\n ...
[ "from trlx.data.method_configs import MethodConfig", "from trlx.data.method_configs import get_method", "from dataclasses import dataclass", "from dataclasses import field", "from typing import Any", "from typing import Dict", "from typing import Optional", "from typing import Set", "import json", ...
[ { "content": [ "class TRLConfig:\n \"\"\"\n Top level config for trlX. Loads configs and can be converted to dictionary.\n \"\"\"\n\n method: MethodConfig\n model: ModelConfig\n optimizer: OptimizerConfig\n scheduler: SchedulerConfig\n tokenizer: TokenizerConfig\n train: TrainCo...
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{"context_start_lineno":0,"fpath_tuple":["CarperAI_trlx","trlx","data","configs.py"],"function_name"(...TRUNCATED)
from_dict@trlx/data/configs.py
{"description":"DOCSTRING","file_path":"trlx/data/configs.py","name":"ModelConfig.from_dict","signat(...TRUNCATED)
{"negative":{"classes":[{"base_classes":[],"code":"class MethodConfig:\n \"\"\"\n Config for a(...TRUNCATED)
["from trlx.data.method_configs import MethodConfig","from trlx.data.method_configs import get_metho(...TRUNCATED)
[{"content":["class MethodConfig:\n \"\"\"\n Config for a certain RL method.\n\n :param nam(...TRUNCATED)
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{"context_start_lineno":0,"fpath_tuple":["CarperAI_trlx","trlx","data","method_configs.py"],"functio(...TRUNCATED)
register_method@trlx/data/method_configs.py
{"description":"Decorator used register a method config\nArgs:\n name: Name of the method","file_(...TRUNCATED)
{"negative":{"classes":[{"base_classes":[],"code":"class MethodConfig:\n \"\"\"\n Config for a(...TRUNCATED)
["from dataclasses import dataclass","from typing import Any","from typing import Dict","import sys"(...TRUNCATED)
[{"content":["class MethodConfig:\n \"\"\"\n Config for a certain RL method.\n\n :param nam(...TRUNCATED)
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{"context_start_lineno":0,"fpath_tuple":["CarperAI_trlx","trlx","data","method_configs.py"],"functio(...TRUNCATED)
register_class@trlx/data/method_configs.py
{"description":"DOCSTRING","file_path":"trlx/data/method_configs.py","name":"register_method.registe(...TRUNCATED)
{"negative":{"classes":[{"base_classes":[],"code":"class MethodConfig:\n \"\"\"\n Config for a(...TRUNCATED)
["from dataclasses import dataclass","from typing import Any","from typing import Dict","import sys"(...TRUNCATED)
[{"content":["def register_class(cls, name):\n _METHODS[name] = cls\n setattr(sys.modu(...TRUNCATED)
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{"context_start_lineno":0,"fpath_tuple":["CarperAI_trlx","trlx","data","method_configs.py"],"functio(...TRUNCATED)
get_method@trlx/data/method_configs.py
{"description":"Return constructor for specified method config","file_path":"trlx/data/method_config(...TRUNCATED)
{"negative":{"classes":[],"functions":[{"code":"def register_class(cls, name):\n _METHODS[nam(...TRUNCATED)
["from dataclasses import dataclass","from typing import Any","from typing import Dict","import sys"(...TRUNCATED)
[{"content":["class MethodConfig:\n \"\"\"\n Config for a certain RL method.\n\n :param nam(...TRUNCATED)
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{"context_start_lineno":0,"fpath_tuple":["CarperAI_trlx","trlx","trainer","__init__.py"],"function_n(...TRUNCATED)
register_trainer@trlx/trainer/__init__.py
{"description":"Decorator used to register a trainer\nArgs:\n name: Name of the trainer type to r(...TRUNCATED)
{"negative":{"classes":[{"base_classes":[],"code":"class BaseRLTrainer:\n def __init__(\n (...TRUNCATED)
["from trlx.data.configs import TRLConfig","from trlx.pipeline import BaseRolloutStore","from abc im(...TRUNCATED)
[{"content":["class BaseRLTrainer:\n def __init__(\n self,\n config: TRLConfig,\n (...TRUNCATED)
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{"context_start_lineno":0,"fpath_tuple":["CarperAI_trlx","trlx","trainer","__init__.py"],"function_n(...TRUNCATED)
register_class@trlx/trainer/__init__.py
{"description":"DOCSTRING","file_path":"trlx/trainer/__init__.py","name":"register_trainer.register_(...TRUNCATED)
{"negative":{"classes":[{"base_classes":[],"code":"class BaseRLTrainer:\n def __init__(\n (...TRUNCATED)
["from trlx.data.configs import TRLConfig","from trlx.pipeline import BaseRolloutStore","from abc im(...TRUNCATED)
[{"content":["def register_class(cls, name):\n _TRAINERS[name] = cls\n setattr(sys.mod(...TRUNCATED)
"You are a Python programmer working with a repository. Here is all the context you may find useful (...TRUNCATED)
{"context_start_lineno":0,"fpath_tuple":["CarperAI_trlx","trlx","utils","loading.py"],"function_name(...TRUNCATED)
_trainer_unavailble@trlx/utils/loading.py
{"description":"DOCSTRING","file_path":"trlx/utils/loading.py","name":"_trainer_unavailble","signatu(...TRUNCATED)
{"negative":{"classes":[{"base_classes":["AccelerateRLTrainer"],"code":"class AccelerateILQLTrainer((...TRUNCATED)
["from trlx.pipeline import _DATAPIPELINE","from trlx.pipeline.offline_pipeline import PromptPipelin(...TRUNCATED)
[{"content":["def log_error(*args, **kwargs):\n raise ImportError(f\"Unable to import NeM(...TRUNCATED)
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
92