repo
stringlengths
7
90
file_url
stringlengths
81
315
file_path
stringlengths
4
228
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 14:38:15
2026-01-05 02:33:18
truncated
bool
2 classes
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/performer/modeling_flax_performer.py
hf-dev-train/transformers-main/examples/research_projects/performer/modeling_flax_performer.py
# coding=utf-8 # Copyright 2018 The Google Flax Team Authors and The HuggingFace Inc. team. # # 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 ...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/adversarial/utils_hans.py
hf-dev-train/transformers-main/examples/research_projects/adversarial/utils_hans.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/adversarial/run_hans.py
hf-dev-train/transformers-main/examples/research_projects/adversarial/run_hans.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/deebert/test_glue_deebert.py
hf-dev-train/transformers-main/examples/research_projects/deebert/test_glue_deebert.py
import argparse import logging import sys from unittest.mock import patch import run_glue_deebert from transformers.testing_utils import TestCasePlus, get_gpu_count, require_torch_non_multi_gpu, slow logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger() def get_setup_file(): parser = argparse...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/deebert/run_glue_deebert.py
hf-dev-train/transformers-main/examples/research_projects/deebert/run_glue_deebert.py
from __future__ import absolute_import, division, print_function import argparse import glob import logging import os import random import time import numpy as np import torch from torch import nn from torch.utils.data import DataLoader, RandomSampler, SequentialSampler, TensorDataset from torch.utils.data.distribute...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/deebert/src/modeling_highway_roberta.py
hf-dev-train/transformers-main/examples/research_projects/deebert/src/modeling_highway_roberta.py
from __future__ import absolute_import, division, print_function, unicode_literals from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from transformers import RobertaConfig from transformers.file_utils import add_start_docstrings, add_start_docstrings_to_model_forward from transformers.models.roberta...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/deebert/src/modeling_highway_bert.py
hf-dev-train/transformers-main/examples/research_projects/deebert/src/modeling_highway_bert.py
import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from transformers.file_utils import add_start_docstrings, add_start_docstrings_to_model_forward from transformers.models.bert.modeling_bert import ( BERT_INPUTS_DOCSTRING, BERT_START_DOCSTRING, BertEmbeddings, BertLayer, ...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/deebert/src/__init__.py
hf-dev-train/transformers-main/examples/research_projects/deebert/src/__init__.py
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/initialize_model.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/initialize_model.py
from arguments import InitializationArguments from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, HfArgumentParser # Configuration parser = HfArgumentParser(InitializationArguments) args = parser.parse_args() # Load codeparrot tokenizer trained for Python code tokenization tokenizer = AutoToke...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/pretokenizing.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/pretokenizing.py
import multiprocessing import time from arguments import PretokenizationArguments from datasets import load_dataset from transformers import AutoTokenizer, HfArgumentParser def tokenize(example): output = {} output["input_ids"] = tokenizer(example["content"], truncation=False)["input_ids"] output["ratio...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/bpe_training.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/bpe_training.py
from arguments import TokenizerTrainingArguments from datasets import load_dataset from tqdm import tqdm from transformers import AutoTokenizer, HfArgumentParser from transformers.models.gpt2.tokenization_gpt2 import bytes_to_unicode # Iterator for Training def batch_iterator(batch_size=10): for _ in tqdm(range(...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/minhash_deduplication.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/minhash_deduplication.py
import json import multiprocessing as mp import re from collections import defaultdict from functools import partial from typing import Dict, List, Optional, Set, Tuple, Type from datasets import Dataset from datasketch import MinHash, MinHashLSH from dpu_utils.utils.iterators import ThreadedIterator from tqdm import ...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/preprocessing.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/preprocessing.py
import gzip import hashlib import json import multiprocessing import os import re import shutil import time from pathlib import Path import numpy as np from arguments import PreprocessingArguments from datasets import load_dataset from minhash_deduplication import deduplicate_dataset from transformers import AutoToke...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/arguments.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/arguments.py
from dataclasses import dataclass, field from typing import Optional @dataclass class TrainingArguments: """ Configuration for training model. """ model_ckpt: Optional[str] = field( default="codeparrot/codeparrot", metadata={"help": "Model name or path of model to be trained."} ) save...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/validation_loss.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/validation_loss.py
import logging import torch from accelerate import Accelerator from arguments import EvaluationArguments from datasets import load_dataset from torch.utils.data import IterableDataset from torch.utils.data.dataloader import DataLoader from transformers import AutoModelForCausalLM, AutoTokenizer, HfArgumentParser, set...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/human_eval.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/human_eval.py
import json import multiprocessing import os import re from collections import defaultdict import torch from accelerate import Accelerator from accelerate.utils import set_seed from arguments import HumanEvalArguments from datasets import load_dataset, load_metric from torch.utils.data import IterableDataset from torc...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/codeparrot_training.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/codeparrot_training.py
import logging import os import time from argparse import Namespace from pathlib import Path import datasets import torch from accelerate import Accelerator, DistributedType from arguments import TrainingArguments from datasets import load_dataset from huggingface_hub import Repository from torch.optim import AdamW fr...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/tests/test_deduplicate.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/tests/test_deduplicate.py
from unittest import TestCase from datasets import Dataset from minhash_deduplication import deduplicate_dataset, make_duplicate_clusters def get_dataset(): data_dict = { "repo_name": ["test_repo1", "test_repo2", "test_repo3"], "path": ["test_1.py", "test_2.py", "unit_test.py"], "content"...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/tests/__init__.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/scripts/tests/__init__.py
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/codeparrot/examples/train_complexity_predictor.py
hf-dev-train/transformers-main/examples/research_projects/codeparrot/examples/train_complexity_predictor.py
import argparse from copy import deepcopy import numpy as np from datasets import ClassLabel, DatasetDict, load_dataset from evaluate import load from transformers import ( AutoModelForSequenceClassification, AutoTokenizer, DataCollatorWithPadding, Trainer, TrainerCallback, TrainingArguments, ...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/onnx/summarization/run_onnx_exporter.py
hf-dev-train/transformers-main/examples/research_projects/onnx/summarization/run_onnx_exporter.py
#!/usr/bin/env python # coding=utf-8 # Copyright The HuggingFace Team and 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.ap...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/onnx/summarization/bart_onnx/reduce_onnx_size.py
hf-dev-train/transformers-main/examples/research_projects/onnx/summarization/bart_onnx/reduce_onnx_size.py
""" Code to remove duplicate initializers to reduce ONNX model size. """ import os import numpy import onnx def _is_equal_tensor_proto(a, b): name_a = a.name name_b = b.name a.name = "" b.name = "" res = a == b a.name = name_a b.name = name_b return res def _node_replace_input_...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/onnx/summarization/bart_onnx/generation_onnx.py
hf-dev-train/transformers-main/examples/research_projects/onnx/summarization/bart_onnx/generation_onnx.py
import copy import itertools from typing import List, Optional, Tuple import torch import torch.nn.functional as F from transformers import BartConfig from transformers.generation import GenerationMixin def _convert_past_list_to_tuple(past_key_values): """ In Bart model, the type of past_key_values is tuple...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/layoutlmv3/run_funsd_cord.py
hf-dev-train/transformers-main/examples/research_projects/layoutlmv3/run_funsd_cord.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2022 The HuggingFace 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-...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/wav2vec2/run_pretrain.py
hf-dev-train/transformers-main/examples/research_projects/wav2vec2/run_pretrain.py
#!/usr/bin/env python3 import logging import sys from dataclasses import dataclass, field from typing import Any, Dict, List, Optional, Union import librosa import torch from datasets import DatasetDict, load_dataset from packaging import version from torch import nn from transformers import ( HfArgumentParser, ...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/wav2vec2/test_wav2vec2_deepspeed.py
hf-dev-train/transformers-main/examples/research_projects/wav2vec2/test_wav2vec2_deepspeed.py
# Copyright 2020 The HuggingFace 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 applicabl...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/wav2vec2/run_asr.py
hf-dev-train/transformers-main/examples/research_projects/wav2vec2/run_asr.py
#!/usr/bin/env python3 import logging import pathlib import re import sys from dataclasses import dataclass, field from typing import Any, Callable, Dict, List, Optional, Set, Union import datasets import librosa import numpy as np import torch from lang_trans import arabic from packaging import version from torch imp...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/wav2vec2/run_common_voice.py
hf-dev-train/transformers-main/examples/research_projects/wav2vec2/run_common_voice.py
#!/usr/bin/env python3 import json import logging import os import re import sys from dataclasses import dataclass, field from typing import Any, Dict, List, Optional, Union import datasets import numpy as np import torch import torchaudio from packaging import version from torch import nn import transformers from tr...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/wav2vec2/alignment.py
hf-dev-train/transformers-main/examples/research_projects/wav2vec2/alignment.py
# Parts of the code are adapted from the snippets provided in the TorchAudio Wav2Vec forced alignment tutorial. # The full tutorial can be found here: https://pytorch.org/audio/stable/tutorials/forced_alignment_tutorial.html import argparse import os from dataclasses import dataclass import torch import torchaudio fr...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/mlm_wwm/run_chinese_ref.py
hf-dev-train/transformers-main/examples/research_projects/mlm_wwm/run_chinese_ref.py
import argparse import json from typing import List from ltp import LTP from transformers.models.bert.tokenization_bert import BertTokenizer def _is_chinese_char(cp): """Checks whether CP is the codepoint of a CJK character.""" # This defines a "chinese character" as anything in the CJK Unicode block: #...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/mlm_wwm/run_mlm_wwm.py
hf-dev-train/transformers-main/examples/research_projects/mlm_wwm/run_mlm_wwm.py
# coding=utf-8 # Copyright 2020 The HuggingFace 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 require...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/xtreme-s/run_xtreme_s.py
hf-dev-train/transformers-main/examples/research_projects/xtreme-s/run_xtreme_s.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2022 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/LI...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
true
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/bertology/run_prune_gpt.py
hf-dev-train/transformers-main/examples/research_projects/bertology/run_prune_gpt.py
#!/usr/bin/env python3 """ This script is adapted from the Bertology pruning code (https://github.com/huggingface/transformers/blob/783d7d2629e97c5f0c5f9ef01b8c66410275c204/examples/research_projects/bertology/run_bertology.py) to prune GPT-like models. The author is @altsoph. """ import argparse import logging import...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/bertology/run_bertology.py
hf-dev-train/transformers-main/examples/research_projects/bertology/run_bertology.py
#!/usr/bin/env python3 # Copyright 2018 CMU and The HuggingFace Inc. team. # # 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 requir...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/model_parallel/run_clm_mp.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/model_parallel/run_clm_mp.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace 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-...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/model_parallel/partitions.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/model_parallel/partitions.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The Google Research Authors and The HuggingFace 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://...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/hybrid_clip/configuration_hybrid_clip.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/hybrid_clip/configuration_hybrid_clip.py
import copy from transformers.configuration_utils import PretrainedConfig from transformers.utils import logging logger = logging.get_logger(__name__) class HybridCLIPConfig(PretrainedConfig): r""" :class:`HybridCLIPConfig` is the configuration class to store the configuration of a :class:`~HybridCLIPM...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/hybrid_clip/run_hybrid_clip.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/hybrid_clip/run_hybrid_clip.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace 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-...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/hybrid_clip/modeling_hybrid_clip.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/hybrid_clip/modeling_hybrid_clip.py
# coding=utf-8 # Copyright 2021 The HuggingFace 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 requir...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/wav2vec2/run_wav2vec2_pretrain_flax.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/wav2vec2/run_wav2vec2_pretrain_flax.py
#!/usr/bin/env python3 import logging import sys import time from dataclasses import field from pathlib import Path from typing import Dict, List, Optional, Union import flax import jax import jax.numpy as jnp import librosa import numpy as np import optax from datasets import DatasetDict, load_dataset from flax impor...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/big_bird/bigbird_flax.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/big_bird/bigbird_flax.py
import json import os from dataclasses import dataclass from functools import partial from typing import Callable import flax.linen as nn import jax import jax.numpy as jnp import joblib import optax import wandb from flax import jax_utils, struct, traverse_util from flax.serialization import from_bytes, to_bytes from...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/big_bird/train.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/big_bird/train.py
import os from dataclasses import replace import jax import wandb from bigbird_flax import Args, DataCollator, FlaxBigBirdForNaturalQuestions, Trainer, build_tx, train_step, val_step from datasets import load_dataset from flax import jax_utils from transformers import BigBirdTokenizerFast if __name__ == "__main__":...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/big_bird/prepare_natural_questions.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/big_bird/prepare_natural_questions.py
import os import jsonlines import numpy as np from tqdm import tqdm DOC_STRIDE = 2048 MAX_LENGTH = 4096 SEED = 42 PROCESS_TRAIN = os.environ.pop("PROCESS_TRAIN", "false") CATEGORY_MAPPING = {"null": 0, "short": 1, "long": 2, "yes": 3, "no": 4} def _get_single_answer(example): def choose_first(answer, is_long_a...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/big_bird/evaluate.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/big_bird/evaluate.py
import jax import jax.numpy as jnp from bigbird_flax import FlaxBigBirdForNaturalQuestions from datasets import load_from_disk from transformers import BigBirdTokenizerFast CATEGORY_MAPPING = {0: "null", 1: "short", 2: "long", 3: "yes", 4: "no"} PUNCTUATION_SET_TO_EXCLUDE = set("".join(["‘", "’", "´", "`", ".", ",",...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/jax-projects/dataset-streaming/run_mlm_flax_stream.py
hf-dev-train/transformers-main/examples/research_projects/jax-projects/dataset-streaming/run_mlm_flax_stream.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 The HuggingFace 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-...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/robust-speech-event/run_speech_recognition_ctc_streaming.py
hf-dev-train/transformers-main/examples/research_projects/robust-speech-event/run_speech_recognition_ctc_streaming.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2022 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/LI...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/robust-speech-event/run_speech_recognition_ctc_bnb.py
hf-dev-train/transformers-main/examples/research_projects/robust-speech-event/run_speech_recognition_ctc_bnb.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2021 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/LI...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/robust-speech-event/eval.py
hf-dev-train/transformers-main/examples/research_projects/robust-speech-event/eval.py
#!/usr/bin/env python3 import argparse import re from typing import Dict import torch from datasets import Audio, Dataset, load_dataset, load_metric from transformers import AutoFeatureExtractor, pipeline def log_results(result: Dataset, args: Dict[str, str]): """DO NOT CHANGE. This function computes and logs t...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/information-gain-filtration/run_clm_igf.py
hf-dev-train/transformers-main/examples/research_projects/information-gain-filtration/run_clm_igf.py
# Copyright 2022 - Intel Corp. All rights reserved. # Authors: Mayank Kumar Raunak, Javier Turek, Nicole Beckage """ Implementation of a new method for fine-tuning transformer models that we call Information Gain Filtration 'IGF' on WikiText data set and compared the results with the standard fine-tuning method Steps...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/information-gain-filtration/igf/igf.py
hf-dev-train/transformers-main/examples/research_projects/information-gain-filtration/igf/igf.py
# Copyright 2022 - Intel Corp. All rights reserved. # Authors: Mayank Kumar Raunak, Javier Turek, Nicole Backage import copy import logging import random import joblib import numpy as np import torch import torch.nn as nn from torch.utils.data import DataLoader from tqdm import tqdm from transformers import AdamW, G...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/information-gain-filtration/igf/__init__.py
hf-dev-train/transformers-main/examples/research_projects/information-gain-filtration/igf/__init__.py
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/_test_bash_script.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/_test_bash_script.py
#!/usr/bin/env python import argparse import os import sys from unittest.mock import patch import pytorch_lightning as pl import timeout_decorator import torch from distillation import SummarizationDistiller, distill_main from finetune import SummarizationModule, main from transformers import MarianMTModel from tran...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/run_eval.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/run_eval.py
#!/usr/bin/env python import argparse import datetime import json import time import warnings from logging import getLogger from pathlib import Path from typing import Dict, List import torch from tqdm import tqdm from transformers import AutoModelForSeq2SeqLM, AutoTokenizer from utils import calculate_bleu, calcula...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/callbacks.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/callbacks.py
import logging from pathlib import Path import numpy as np import pytorch_lightning as pl import torch from pytorch_lightning.callbacks import EarlyStopping, ModelCheckpoint from pytorch_lightning.utilities import rank_zero_only from utils import save_json def count_trainable_parameters(model): model_parameters...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/_test_make_student.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/_test_make_student.py
import tempfile import unittest from make_student import create_student_by_copying_alternating_layers from transformers import AutoConfig from transformers.file_utils import cached_property from transformers.testing_utils import require_torch TINY_BART = "sshleifer/bart-tiny-random" TINY_T5 = "patrickvonplaten/t5-t...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/finetune.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/finetune.py
#!/usr/bin/env python import argparse import glob import logging import os import sys import time from collections import defaultdict from pathlib import Path from typing import Dict, List, Tuple import numpy as np import pytorch_lightning as pl import torch from callbacks import Seq2SeqLoggingCallback, get_checkpoin...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/_test_seq2seq_examples.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/_test_seq2seq_examples.py
import argparse import logging import os import sys import tempfile from pathlib import Path import lightning_base import pytest import pytorch_lightning as pl import torch from convert_pl_checkpoint_to_hf import convert_pl_to_hf from distillation import distill_main from finetune import SummarizationModule, main from...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/_test_seq2seq_examples_multi_gpu.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/_test_seq2seq_examples_multi_gpu.py
# as due to their complexity multi-gpu tests could impact other tests, and to aid debug we have those in a separate module. import os import sys from pathlib import Path import torch from transformers.testing_utils import TestCasePlus, execute_subprocess_async, require_torch_multi_gpu from utils import load_json C...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/sentence_splitter.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/sentence_splitter.py
import re from filelock import FileLock try: import nltk NLTK_AVAILABLE = True except (ImportError, ModuleNotFoundError): NLTK_AVAILABLE = False if NLTK_AVAILABLE: with FileLock(".lock") as lock: nltk.download("punkt", quiet=True) def add_newline_to_end_of_each_sentence(x: str) -> str: ...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/lightning_base.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/lightning_base.py
import argparse import logging import os from pathlib import Path from typing import Any, Dict import pytorch_lightning as pl from pytorch_lightning.utilities import rank_zero_info from transformers import ( AdamW, AutoConfig, AutoModel, AutoModelForPreTraining, AutoModelForQuestionAnswering, ...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/utils.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/utils.py
import itertools import json import linecache import math import os import pickle import socket from logging import getLogger from pathlib import Path from typing import Callable, Dict, Iterable, List, Tuple, Union import git import numpy as np import torch import torch.distributed as dist from rouge_score import roug...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/convert_pl_checkpoint_to_hf.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/convert_pl_checkpoint_to_hf.py
#!/usr/bin/env python import os from pathlib import Path from typing import Dict, List import fire import torch from transformers import AutoModelForSeq2SeqLM, AutoTokenizer from transformers.utils.logging import get_logger logger = get_logger(__name__) def remove_prefix(text: str, prefix: str): if text.star...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/make_student.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/make_student.py
import warnings from pathlib import Path from typing import List, Tuple, Union import fire from torch import nn from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, PreTrainedModel from transformers.utils import logging logger = logging.get_logger(__name__) def copy_layers(src_layers: nn.ModuleList, des...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/distillation.py
hf-dev-train/transformers-main/examples/research_projects/seq2seq-distillation/distillation.py
#!/usr/bin/env python import argparse import gc import os import sys from pathlib import Path from typing import List # noqa: F401 import pytorch_lightning as pl import torch from finetune import SummarizationModule, TranslationModule from finetune import main as ft_main from make_student import create_student_by_co...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/run_glue_with_pabee.py
hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/run_glue_with_pabee.py
# coding=utf-8 # Copyright 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and Microsoft Corporation. # Copyright (c) 2018, NVIDIA CORPORATION. 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....
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/test_run_glue_with_pabee.py
hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/test_run_glue_with_pabee.py
import argparse import logging import sys from unittest.mock import patch import run_glue_with_pabee from transformers.testing_utils import TestCasePlus logging.basicConfig(level=logging.DEBUG) logger = logging.getLogger() def get_setup_file(): parser = argparse.ArgumentParser() parser.add_argument("-f")...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/pabee/modeling_pabee_bert.py
hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/pabee/modeling_pabee_bert.py
# coding=utf-8 # Copyright 2020 The Google AI Language Team Authors, The HuggingFace Inc. team and Microsoft Corporation. # Copyright (c) 2018, NVIDIA CORPORATION. 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....
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/pabee/modeling_pabee_albert.py
hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/pabee/modeling_pabee_albert.py
# coding=utf-8 # Copyright 2020 Google AI, Google Brain, the HuggingFace Inc. team and Microsoft Corporation. # # 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/lic...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/pabee/__init__.py
hf-dev-train/transformers-main/examples/research_projects/bert-loses-patience/pabee/__init__.py
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_missing_tokenization_test/cookiecutter-template-{{cookiecutter.modelname}}/test_tokenization_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_missing_tokenization_test/cookiecutter-template-{{cookiecutter.modelname}}/test_tokenization_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 {{cookiecutter.authors}}. 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 re...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py
hf-dev-train/transformers-main/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py
#!/usr/bin/env python # coding=utf-8 # Copyright 2022 {{cookiecutter.authors}} and 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...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
true
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 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 r...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
true
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_flax_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_flax_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 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 r...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/to_replace_{{cookiecutter.lowercase_modelname}}.py
## Copyright 2022 The HuggingFace 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 ...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 {{cookiecutter.authors}} 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...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
true
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 {{cookiecutter.authors}} and 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/lice...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/__init__.py
# Copyright 2020 The HuggingFace 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 applicabl...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_tf_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/test_modeling_tf_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 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 r...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
true
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/configuration_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/configuration_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 {{cookiecutter.authors}} and 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/lice...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_fast_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/tokenization_fast_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 {{cookiecutter.authors}} and 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/lice...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_flax_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_flax_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 {{cookiecutter.authors}} and 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/lice...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
true
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py
hf-dev-train/transformers-main/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py
# coding=utf-8 # Copyright 2022 {{cookiecutter.authors}} and 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/lice...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
true
Sreyan88/GAMA
https://github.com/Sreyan88/GAMA/blob/041c3a623c6c635e65463cef16ce0cfde72e5c57/hf-dev-train/transformers-main/.circleci/create_circleci_config.py
hf-dev-train/transformers-main/.circleci/create_circleci_config.py
# coding=utf-8 # Copyright 2022 The HuggingFace Inc. team. # # 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...
python
Apache-2.0
041c3a623c6c635e65463cef16ce0cfde72e5c57
2026-01-05T07:09:59.331526Z
false
zgw21cn/FeedlyClient
https://github.com/zgw21cn/FeedlyClient/blob/1a344063820c8cc09dd9213d7206bf5719eb221f/client.py
client.py
# -*- coding: UTF-8 -*- import requests import json class FeedlyClient(object): def __init__(self, **options): self.client_id = options.get('client_id') self.client_secret = options.get('client_secret') self.sandbox = options.get('sandbox', True) if self.sandbox: default...
python
MIT
1a344063820c8cc09dd9213d7206bf5719eb221f
2026-01-05T07:10:21.659473Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/fuzz/interconnect.py
util/fuzz/interconnect.py
""" Utilities for fuzzing interconect """ import threading import tiles import libpyprjoxide import fuzzconfig import fuzzloops import lapie def fuzz_interconnect( config, nodenames, regex=False, nodename_predicate=lambda x, nets: True, pip_predicate=lambda x, nets: True, ...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/fuzz/fuzzconfig.py
util/fuzz/fuzzconfig.py
""" This module provides a structure to define the fuzz environment """ import os from os import path from string import Template import radiant import database import libpyprjoxide db = None class FuzzConfig: def __init__(self, device, job, tiles, sv): """ :param job: user-friendly job name, used...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/fuzz/get_params.py
util/fuzz/get_params.py
import re, sys # Read a Lattice Verilog file and extract the parameters and their widths/set of values ov_re = re.compile(r'\\otherValues = "{([^}]*)}"') p_re = re.compile(r'parameter ([A-Z0-9a-z_]*) = "([^"]*)"') # returns [(word_name, word_length)], [(enum_name, [enum_values])] def get_params(f): words = [] enums...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/fuzz/fuzzloops.py
util/fuzz/fuzzloops.py
""" General Utilities for Fuzzing """ import os from threading import Thread, RLock def parallel_foreach(items, func): """ Run a function over a list of values, running a number of jobs in parallel. OXIDE_JOBS should be set to the number of jobs to run, defaulting to 4. """ if "OXIDE_JOBS" in ...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/fuzz/nonrouting.py
util/fuzz/nonrouting.py
""" Utilities for fuzzing non-routing configuration. This is the counterpart to interconnect.py """ import threading import tiles import libpyprjoxide import fuzzconfig def fuzz_word_setting(config, name, length, get_sv_substs, desc=""): """ Fuzz a multi-bit setting, such as LUT initialisation :param con...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/common/lapie.py
util/common/lapie.py
""" Python wrapper for `lapie` """ from os import path import os import subprocess import database import tempfile import re def run(commands, workdir=None): """Run a list of Tcl commands, returning the output as a string""" rcmd_path = path.join(database.get_oxide_root(), "radiant_cmd.sh") if workdir is N...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/common/radiant.py
util/common/radiant.py
""" Python wrapper for `radiant.sh` """ from os import path import os import subprocess import database def run(device, source, struct_ver=True, raw_bit=False, pdcfile=None, rbk_mode=False): """ Run radiant.sh with a given device name and source Verilog file """ env = os.environ.copy() if struct_v...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/common/database.py
util/common/database.py
""" Database and Database Path Management """ import os from os import path import json import subprocess def get_oxide_root(): """Return the absolute path to the Project Oxide repo root""" return path.abspath(path.join(__file__, "../../../")) def get_db_root(): """ Return the path containing the Pr...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/common/__init__.py
util/common/__init__.py
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/util/common/tiles.py
util/common/tiles.py
import re pos_re = re.compile(r'R(\d+)C(\d+)') def pos_from_name(tile): """ Extract the tile position as a (row, column) tuple from its name """ s = pos_re.search(tile) assert s return int(s.group(1)), int(s.group(2)) def type_from_fullname(tile): """ Extract the type from a full ti...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/tools/test_sites.py
tools/test_sites.py
#!/usr/bin/env python3 """ Convert the tile grid for a given family and device to HTML format """ import sys, re import argparse import database import libpyprjoxide def main(argv): db = libpyprjoxide.Database(database.get_db_root()) libpyprjoxide.build_sites(db, "LIFCL-40", "PLC") if __name__ == "__main__":...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/tools/bitstreamcache.py
tools/bitstreamcache.py
#!/usr/bin/env python3 """ Bitstream cache tool for prjoxide This avoids expensive bitstream rebuilds when making small changes to the fuzzer and the Verilog input is largely unchanged. Note that it is disabled by default. Run: tools/bitstreamcache.py init to start using it. Usage: tools/bitstreamcache.py fe...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/tools/html_all.py
tools/html_all.py
#!/usr/bin/env python3 """ Project Oxide Master HTML Generation Script Usage: html_all.py <output_folder> """ import os, sys, time from os import path from string import Template import argparse import database import html_tilegrid import html_tilebits import fuzzloops import glob import libpyprjoxide oxide_docs_ind...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/tools/tilegrid_all.py
tools/tilegrid_all.py
#!/usr/bin/env python3 """ For each family and device, obtain a tilegrid and save it in the database """ import os from os import path import subprocess import extract_tilegrid import database def main(): devices = database.get_devices() for family in sorted(devices["families"].keys()): for device i...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/tools/parse_pins.py
tools/parse_pins.py
import json, sys # Parse a Lattice pinout CSV file to a JSON file for the database # Usage: parse_pins.py pinout.csv iodb.json def main(): packages = [] pads = [] with open(sys.argv[1], "r") as csvf: for line in csvf: sl = line.replace('"', '') sl = sl.strip() if len(sl) == 0 or sl.startswith('#'): ...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false
gatecat/prjoxide
https://github.com/gatecat/prjoxide/blob/30712ff988a3ea7700fa11b87ae2d77e55c7c468/tools/html_tilegrid.py
tools/html_tilegrid.py
#!/usr/bin/env python3 """ Convert the tile grid for a given family and device to HTML format """ import sys, re import argparse import database import libpyprjoxide parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('family', type=str, help="FPGA family (e.g. LIFCL)") parser...
python
ISC
30712ff988a3ea7700fa11b87ae2d77e55c7c468
2026-01-05T07:10:26.543741Z
false