text
stringlengths
5
22M
id
stringlengths
12
177
metadata
dict
__index_level_0__
int64
0
1.37k
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. DATA_DIR=../../data/PubMedQA prefix=pqal_qcl_ansis RAW_DATA_DIR=${DATA_DIR}/raw OUTPUT_DIR=${DATA_DIR}/${prefix}-bin if [ -d "${OUTPUT_DIR}" ]; then rm -rf ${OUTPUT_DIR} fi python rebuild_data.py ${RAW_DATA_DIR} ${prefix} cp ${DATA_DIR}/.....
BioGPT/examples/QA-PubMedQA/preprocess.sh/0
{ "file_path": "BioGPT/examples/QA-PubMedQA/preprocess.sh", "repo_id": "BioGPT", "token_count": 725 }
143
# Relation Extraction on KD-DTI ## Data According to the original [KD-DTI dataset](https://github.com/bert-nmt/BERT-DTI), before processing the data, you should first register a DrugBank account, download the xml dataset and replace the entity id with the entity name in the drugbank. Then, you can process the data by...
BioGPT/examples/RE-DTI/README.md/0
{ "file_path": "BioGPT/examples/RE-DTI/README.md", "repo_id": "BioGPT", "token_count": 235 }
144
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import logging from dataclasses import dataclass, field from typing import Optional, Dict, List, Tuple from argparse import Namespace import torch from torch import Tensor import torch.nn as nn import torch.nn.functional as F from fairseq import...
BioGPT/src/transformer_lm_prompt.py/0
{ "file_path": "BioGPT/src/transformer_lm_prompt.py", "repo_id": "BioGPT", "token_count": 1294 }
145
--- license: mit --- This is a BitBLAS Implementation for the reproduced 1.58bit model from [1bitLLM/bitnet_b1_58-3B](https://huggingface.co/1bitLLM/bitnet_b1_58-3B). We replaced the original simulated Int8x3bit Quantized Inference Kernel with BitBLAS INT8xINT2 Kernel. We also evaluated the model's correctness and per...
BitBLAS/integration/BitNet/README.md/0
{ "file_path": "BitBLAS/integration/BitNet/README.md", "repo_id": "BitBLAS", "token_count": 1775 }
146
#!/bin/bash # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. echo "Check MIT License boilerplate..." PWD="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # To source code root pushd "${PWD}/../../" > /dev/null EXITCODE=0 for SRC_FILE in $(find . -path './3rdparty' -prune -false -o -path '...
BitBLAS/maint/scripts/check_mit_license.sh/0
{ "file_path": "BitBLAS/maint/scripts/check_mit_license.sh", "repo_id": "BitBLAS", "token_count": 464 }
147
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """Benifit For BitBLAS Schedule""" class Block: def __init__(self, start, end, is_free): self.start = start self.end = end self.is_free = is_free def size(self) -> int: return self.end - self.start de...
BitBLAS/python/bitblas/base/roller/bestfit.py/0
{ "file_path": "BitBLAS/python/bitblas/base/roller/bestfit.py", "repo_id": "BitBLAS", "token_count": 1117 }
148
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. class BitBLASGenerator: def __init__(self): # Initialize the generator with configuration pass def generate_cuda_code(self): pass def generate_header(self): pass
BitBLAS/python/bitblas/generator.py/0
{ "file_path": "BitBLAS/python/bitblas/generator.py", "repo_id": "BitBLAS", "token_count": 104 }
149
# Copyright 2018 The apache/tvm Authors. All Rights Reserved. # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under th...
BitBLAS/python/bitblas/gpu/rmsnorm.py/0
{ "file_path": "BitBLAS/python/bitblas/gpu/rmsnorm.py", "repo_id": "BitBLAS", "token_count": 1961 }
150
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import tvm from tvm.target import Target from bitblas.base.roller.arch.cuda import CUDA from typing import Any, List, Literal, Optional, Tuple, Union from .operator import Operator, TransformKind from .impl.matmul_dequantize_impl import select_imp...
BitBLAS/python/bitblas/ops/matmul_dequantize.py/0
{ "file_path": "BitBLAS/python/bitblas/ops/matmul_dequantize.py", "repo_id": "BitBLAS", "token_count": 4993 }
151
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import tvm from typing import Optional, List, Dict, Union from tvm import IRModule from bitblas import TileDevice from tvm.runtime import ndarray from bitblas.utils import match_global_kernel import re import ctypes import os import tempfile impor...
BitBLAS/python/bitblas/wrapper/general.py/0
{ "file_path": "BitBLAS/python/bitblas/wrapper/general.py", "repo_id": "BitBLAS", "token_count": 9565 }
152
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import pytest import bitblas from bitblas.ops.ladder_permutate import LadderPermutate, LadderPermutateConfig import tvm target = tvm.target.Target("llvm") # fmt: off @pytest.mark.parametrize( "M,N,datatype,dequantize_bits,storage_dtype,prop...
BitBLAS/testing/python/operators/test_ladder_permutate_ops.py/0
{ "file_path": "BitBLAS/testing/python/operators/test_ladder_permutate_ops.py", "repo_id": "BitBLAS", "token_count": 1273 }
153
from ..datasets import SNLIDataset from .datamodule_base import BaseDataModule from collections import defaultdict class SNLIDataModule(BaseDataModule): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @property def dataset_cls(self): return SNLIDataset @propert...
BridgeTower/src/datamodules/snli_datamodule.py/0
{ "file_path": "BridgeTower/src/datamodules/snli_datamodule.py", "repo_id": "BridgeTower", "token_count": 146 }
154
# 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...
BridgeTower/src/modules/bert_model.py/0
{ "file_path": "BridgeTower/src/modules/bert_model.py", "repo_id": "BridgeTower", "token_count": 35244 }
155
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from data.base_dataset import BaseDataset, get_params, get_transform from PIL import Image import util.util as util import os import torch class FaceTestDataset(BaseDataset): @staticmethod def modify_commandline_options(parser, is_train...
Bringing-Old-Photos-Back-to-Life/Face_Enhancement/data/face_dataset.py/0
{ "file_path": "Bringing-Old-Photos-Back-to-Life/Face_Enhancement/data/face_dataset.py", "repo_id": "Bringing-Old-Photos-Back-to-Life", "token_count": 1513 }
156
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import torch import torch.nn.parallel import numpy as np import torch.nn as nn import torch.nn.functional as F class Downsample(nn.Module): # https://github.com/adobe/antialiased-cnns def __init__(self, pad_type="reflect", filt_size=3,...
Bringing-Old-Photos-Back-to-Life/Global/detection_models/antialiasing.py/0
{ "file_path": "Bringing-Old-Photos-Back-to-Life/Global/detection_models/antialiasing.py", "repo_id": "Bringing-Old-Photos-Back-to-Life", "token_count": 1278 }
157
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import time from collections import OrderedDict from options.train_options import TrainOptions from data.data_loader import CreateDataLoader from models.models import create_da_model import util.util as util from util.visualizer import Visualizer...
Bringing-Old-Photos-Back-to-Life/Global/train_domain_A.py/0
{ "file_path": "Bringing-Old-Photos-Back-to-Life/Global/train_domain_A.py", "repo_id": "Bringing-Old-Photos-Back-to-Life", "token_count": 2281 }
158
# TEXT ENCODER CONFIG text_model: 'bert-base-uncased' text_len: 100 transformer_embed_dim: 768 freeze_text_encoder_weights: True # AUDIO ENCODER CONFIG audioenc_name: 'Cnn14' out_emb: 2048 sampling_rate: 44100 duration: 5 fmin: 50 fmax: 14000 n_fft: 1028 hop_size: 320 mel_bins: 64 window_size: 1024 # PROJECTION SPACE...
CLAP/msclap/configs/config_2022.yml/0
{ "file_path": "CLAP/msclap/configs/config_2022.yml", "repo_id": "CLAP", "token_count": 178 }
159
.. _Command-line Tools: Command-line Tools ================== Fairseq provides several command-line tools for training and evaluating models: - :ref:`fairseq-preprocess`: Data pre-processing: build vocabularies and binarize training data - :ref:`fairseq-train`: Train a new model on one or multiple GPUs - :ref:`fairs...
COCO-LM/fairseq/docs/command_line_tools.rst/0
{ "file_path": "COCO-LM/fairseq/docs/command_line_tools.rst", "repo_id": "COCO-LM", "token_count": 714 }
160
#!/bin/bash SCRIPTS=mosesdecoder/scripts TOKENIZER=$SCRIPTS/tokenizer/tokenizer.perl NORM_PUNC=$SCRIPTS/tokenizer/normalize-punctuation.perl REM_NON_PRINT_CHAR=$SCRIPTS/tokenizer/remove-non-printing-char.perl BPEROOT=subword-nmt/subword_nmt BPE_CODE=wmt18_en_de/code SUBSAMPLE_SIZE=25000000 LANG=de OUTDIR=wmt18_${L...
COCO-LM/fairseq/examples/backtranslation/prepare-de-monolingual.sh/0
{ "file_path": "COCO-LM/fairseq/examples/backtranslation/prepare-de-monolingual.sh", "repo_id": "COCO-LM", "token_count": 1519 }
161
# Convolutional Sequence to Sequence Learning (Gehring et al., 2017) ## Pre-trained models Description | Dataset | Model | Test set(s) ---|---|---|--- Convolutional <br> ([Gehring et al., 2017](https://arxiv.org/abs/1705.03122)) | [WMT14 English-French](http://statmt.org/wmt14/translation-task.html#Download) | [downl...
COCO-LM/fairseq/examples/conv_seq2seq/README.md/0
{ "file_path": "COCO-LM/fairseq/examples/conv_seq2seq/README.md", "repo_id": "COCO-LM", "token_count": 786 }
162
# Fully Sharded Data Parallel (FSDP) ## Overview Recent work by [Microsoft](https://arxiv.org/abs/1910.02054) and [Google](https://arxiv.org/abs/2004.13336) has shown that data parallel training can be made significantly more efficient by sharding the model parameters and optimizer state across data parallel workers. ...
COCO-LM/fairseq/examples/fully_sharded_data_parallel/README.md/0
{ "file_path": "COCO-LM/fairseq/examples/fully_sharded_data_parallel/README.md", "repo_id": "COCO-LM", "token_count": 6076 }
163
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math from typing import Dict, Optional, Tuple import torch import torch.nn.functional as F from fairseq import utils from fairseq.incr...
COCO-LM/fairseq/examples/linformer/linformer_src/modules/multihead_linear_attention.py/0
{ "file_path": "COCO-LM/fairseq/examples/linformer/linformer_src/modules/multihead_linear_attention.py", "repo_id": "COCO-LM", "token_count": 9896 }
164
# Megatron-11b Megatron-11b is a unidirectional language model with `11B` parameters based on [Megatron-LM](https://arxiv.org/pdf/1909.08053.pdf). Following the original Megatron work, we trained the model using intra-layer model parallelism with each layer's parameters split across 8 GPUs. Megatron-11b is trained on...
COCO-LM/fairseq/examples/megatron_11b/README.md/0
{ "file_path": "COCO-LM/fairseq/examples/megatron_11b/README.md", "repo_id": "COCO-LM", "token_count": 1857 }
165
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import itertools import os import csv from collections import defaultdict from six.moves import zip import io import wget import sys from su...
COCO-LM/fairseq/examples/multilingual/data_scripts/download_ted_and_extract.py/0
{ "file_path": "COCO-LM/fairseq/examples/multilingual/data_scripts/download_ted_and_extract.py", "repo_id": "COCO-LM", "token_count": 6376 }
166
#!/usr/bin/env python3 -u # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Generate n-best translations using a trained model. """ import os import subprocess from contextlib import redi...
COCO-LM/fairseq/examples/noisychannel/rerank_generate.py/0
{ "file_path": "COCO-LM/fairseq/examples/noisychannel/rerank_generate.py", "repo_id": "COCO-LM", "token_count": 7803 }
167
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse from itertools import zip_longest def replace_oovs(source_in, target_in, vocabulary, source_out, targ...
COCO-LM/fairseq/examples/pointer_generator/preprocess.py/0
{ "file_path": "COCO-LM/fairseq/examples/pointer_generator/preprocess.py", "repo_id": "COCO-LM", "token_count": 1473 }
168
# Finetuning RoBERTa on Winograd Schema Challenge (WSC) data The following instructions can be used to finetune RoBERTa on the WSC training data provided by [SuperGLUE](https://super.gluebenchmark.com/). Note that there is high variance in the results. For our GLUE/SuperGLUE submission we swept over the learning rate...
COCO-LM/fairseq/examples/roberta/wsc/README.md/0
{ "file_path": "COCO-LM/fairseq/examples/roberta/wsc/README.md", "repo_id": "COCO-LM", "token_count": 2057 }
169
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from fairseq.modules import LayerNorm, TransformerDecoderLayer, TransformerEncoderLayer from . import build_monotonic_attention class Trans...
COCO-LM/fairseq/examples/simultaneous_translation/modules/monotonic_transformer_layer.py/0
{ "file_path": "COCO-LM/fairseq/examples/simultaneous_translation/modules/monotonic_transformer_layer.py", "repo_id": "COCO-LM", "token_count": 932 }
170
#!/usr/bin/env bash # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # Prepare librispeech dataset base_url=www.openslr.org/resources/12 train_dir=train_960 if [ "$#" -ne 2 ]; then echo "...
COCO-LM/fairseq/examples/speech_recognition/datasets/prepare-librispeech.sh/0
{ "file_path": "COCO-LM/fairseq/examples/speech_recognition/datasets/prepare-librispeech.sh", "repo_id": "COCO-LM", "token_count": 1499 }
171
[[Back]](..) # S2T Example: ST on CoVoST We replicate the experiments in [CoVoST 2 and Massively Multilingual Speech-to-Text Translation (Wang et al., 2020)](https://arxiv.org/abs/2007.10310). ## Data Preparation [Download](https://commonvoice.mozilla.org/en/datasets) and unpack Common Voice v4 to a path `${COVOST_RO...
COCO-LM/fairseq/examples/speech_to_text/docs/covost_example.md/0
{ "file_path": "COCO-LM/fairseq/examples/speech_to_text/docs/covost_example.md", "repo_id": "COCO-LM", "token_count": 2329 }
172
# @package _group_ common: fp16: true log_format: json log_interval: 200 checkpoint: no_epoch_checkpoints: true best_checkpoint_metric: wer task: _name: audio_pretraining data: ??? normalize: false labels: ltr dataset: num_workers: 6 max_tokens: 3200000 skip_invalid_size_inputs_valid_test: t...
COCO-LM/fairseq/examples/wav2vec/config/finetuning/base_100h.yaml/0
{ "file_path": "COCO-LM/fairseq/examples/wav2vec/config/finetuning/base_100h.yaml", "repo_id": "COCO-LM", "token_count": 419 }
173
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Helper script to pre-compute embeddings for a flashlight (previously called wav2letter++) dataset """ import argpa...
COCO-LM/fairseq/examples/wav2vec/wav2vec_featurize.py/0
{ "file_path": "COCO-LM/fairseq/examples/wav2vec/wav2vec_featurize.py", "repo_id": "COCO-LM", "token_count": 3207 }
174
/** * Copyright 2017-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the license found in the * LICENSE file in the root directory of this source tree. */ #include <Python.h> static PyMethodDef method_def[] = { {NULL, NULL, 0, NULL} }; static struct PyModuleDef module_d...
COCO-LM/fairseq/fairseq/clib/libbleu/module.cpp/0
{ "file_path": "COCO-LM/fairseq/fairseq/clib/libbleu/module.cpp", "repo_id": "COCO-LM", "token_count": 293 }
175
# @package _group_ activation: gelu vq_type: gumbel vq_depth: 2 combine_groups: true
COCO-LM/fairseq/fairseq/config/model/wav2vec/vq_wav2vec_gumbel.yaml/0
{ "file_path": "COCO-LM/fairseq/fairseq/config/model/wav2vec/vq_wav2vec_gumbel.yaml", "repo_id": "COCO-LM", "token_count": 35 }
176
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import torch import torch.nn.functional as F import scipy.stats as stats import numpy as np from fairseq import metrics, utils ...
COCO-LM/fairseq/fairseq/criterions/sentence_prediction.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/criterions/sentence_prediction.py", "repo_id": "COCO-LM", "token_count": 2879 }
177
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from torch.utils.data.dataloader import default_collate from . import FairseqDataset class BaseWrapperDataset(FairseqDataset): def __in...
COCO-LM/fairseq/fairseq/data/base_wrapper_dataset.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/data/base_wrapper_dataset.py", "repo_id": "COCO-LM", "token_count": 972 }
178
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from dataclasses import dataclass, field from fairseq import file_utils from fairseq.data.encoders import register_bpe from fairseq.dataclass...
COCO-LM/fairseq/fairseq/data/encoders/gpt2_bpe.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/data/encoders/gpt2_bpe.py", "repo_id": "COCO-LM", "token_count": 642 }
179
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from .block_pair_dataset import BlockPairDataset from .masked_lm_dataset import MaskedLMDataset from .masked_lm_dictionary import BertDictiona...
COCO-LM/fairseq/fairseq/data/legacy/__init__.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/data/legacy/__init__.py", "repo_id": "COCO-LM", "token_count": 158 }
180
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging from typing import List logger = logging.getLogger(__name__) def uniform(dataset_sizes: List[int]): return [1.0] * len(...
COCO-LM/fairseq/fairseq/data/multilingual/sampling_method.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/data/multilingual/sampling_method.py", "repo_id": "COCO-LM", "token_count": 905 }
181
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import numpy as np from . import BaseWrapperDataset class SortDataset(BaseWrapperDataset): def __init__(self, dataset, sort_order): ...
COCO-LM/fairseq/fairseq/data/sort_dataset.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/data/sort_dataset.py", "repo_id": "COCO-LM", "token_count": 234 }
182
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """isort:skip_file""" import logging from hydra.core.config_store import ConfigStore from fairseq.dataclass.configs import FairseqConfig from ...
COCO-LM/fairseq/fairseq/dataclass/initialize.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/dataclass/initialize.py", "repo_id": "COCO-LM", "token_count": 894 }
183
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ A standalone module for aggregating metrics. Metrics can be logged from anywhere using the `log_*` functions defined in this module. The l...
COCO-LM/fairseq/fairseq/logging/metrics.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/logging/metrics.py", "repo_id": "COCO-LM", "token_count": 3561 }
184
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from fairseq.model_parallel.modules import ModelParallelMultiheadAttention from fairseq.modules import TransformerDecoderLayer, TransformerEnc...
COCO-LM/fairseq/fairseq/model_parallel/modules/transformer_layer.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/model_parallel/modules/transformer_layer.py", "repo_id": "COCO-LM", "token_count": 1192 }
185
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import importlib import os # automatically import any Python files in the models/huggingface/ directory models_dir = os.path.dirname(__file_...
COCO-LM/fairseq/fairseq/models/huggingface/__init__.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/models/huggingface/__init__.py", "repo_id": "COCO-LM", "token_count": 258 }
186
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from fairseq.models import register_model, register_model_architecture from fairseq.models.nat import NATransformerModel, base_architecture f...
COCO-LM/fairseq/fairseq/models/nat/nat_crf_transformer.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/models/nat/nat_crf_transformer.py", "repo_id": "COCO-LM", "token_count": 2094 }
187
#!/usr/bin/env python3 # Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import log...
COCO-LM/fairseq/fairseq/models/speech_to_text/utils.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/models/speech_to_text/utils.py", "repo_id": "COCO-LM", "token_count": 6766 }
188
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import functools from typing import Any, Dict, List, Tuple, Union import torch import torch.utils.checkpoint as checkpoint from fairseq impo...
COCO-LM/fairseq/fairseq/modules/checkpoint_activations.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/modules/checkpoint_activations.py", "repo_id": "COCO-LM", "token_count": 3538 }
189
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. """ Layer norm done in fp32 (for fp16 training) """ import torch.nn as nn import torch.nn.functional as F class Fp32GroupNorm(nn.GroupNorm):...
COCO-LM/fairseq/fairseq/modules/fp32_group_norm.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/modules/fp32_group_norm.py", "repo_id": "COCO-LM", "token_count": 294 }
190
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch import torch.nn.functional as F from fairseq import utils from fairseq.incremental_decoding_utils import with_incremental_state ...
COCO-LM/fairseq/fairseq/modules/linearized_convolution.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/modules/linearized_convolution.py", "repo_id": "COCO-LM", "token_count": 1912 }
191
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch from ..ops import emulate_int class ActivationQuantizer: """ Fake scalar quantization of the activations using a forwa...
COCO-LM/fairseq/fairseq/modules/quantization/scalar/modules/qact.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/modules/quantization/scalar/modules/qact.py", "repo_id": "COCO-LM", "token_count": 1304 }
192
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import torch.nn.functional as F def unfold1d(x, kernel_size, padding_l, pad_value=0): """unfold T x B x C to T x B x C x K""" if ker...
COCO-LM/fairseq/fairseq/modules/unfold.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/modules/unfold.py", "repo_id": "COCO-LM", "token_count": 263 }
193
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import types import torch def get_fused_adam_class(): """ Look for the FusedAdam optimizer from apex. We first try to load the ...
COCO-LM/fairseq/fairseq/optim/fused_adam.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/optim/fused_adam.py", "repo_id": "COCO-LM", "token_count": 2948 }
194
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse from typing import Callable, List, Optional import torch from fairseq import utils from fairseq.data.indexed_dataset import g...
COCO-LM/fairseq/fairseq/options.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/options.py", "repo_id": "COCO-LM", "token_count": 5496 }
195
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import os import warnings from argparse import Namespace from typing import Any, Callable, Dict, List import torch from fairse...
COCO-LM/fairseq/fairseq/tasks/fairseq_task.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/tasks/fairseq_task.py", "repo_id": "COCO-LM", "token_count": 10809 }
196
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import datetime import logging import time import torch from fairseq.data import ( FairseqDataset, LanguagePairDataset, ListDatas...
COCO-LM/fairseq/fairseq/tasks/translation_multi_simple_epoch.py/0
{ "file_path": "COCO-LM/fairseq/fairseq/tasks/translation_multi_simple_epoch.py", "repo_id": "COCO-LM", "token_count": 8266 }
197
#include "ATen/ATen.h" #include "ATen/cuda/CUDAContext.h" #include "ATen/cuda/detail/IndexUtils.cuh" #include <cuda.h> #include <cuda_runtime.h> #include <stdio.h> #include <cmath> #include "ATen/TensorUtils.h" #include "ATen/AccumulateType.h" #include <THC/THCGeneral.h> #include "type_shim.h" template <typename T, t...
COCO-LM/fairseq/fused_ops/csrc/adam/adam_kernel.cu/0
{ "file_path": "COCO-LM/fairseq/fused_ops/csrc/adam/adam_kernel.cu", "repo_id": "COCO-LM", "token_count": 2098 }
198
import torch from torch.utils import cpp_extension from setuptools import setup, find_packages import subprocess import sys import warnings import os import site site.ENABLE_USER_SITE = True # ninja build does not work unless include_dirs are abs path this_dir = os.path.dirname(os.path.abspath(__file__)) def get_c...
COCO-LM/fairseq/fused_ops/setup.py/0
{ "file_path": "COCO-LM/fairseq/fused_ops/setup.py", "repo_id": "COCO-LM", "token_count": 3664 }
199
#!/usr/bin/env python3 # # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import sys """Reads in a fairseq output file, and verifies that the constraints (C- lines) are present in the outpu...
COCO-LM/fairseq/scripts/constraints/validate.py/0
{ "file_path": "COCO-LM/fairseq/scripts/constraints/validate.py", "repo_id": "COCO-LM", "token_count": 367 }
200
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import functools import random import unittest from multiprocessing import Manager import torch import torch.nn as nn from fa...
COCO-LM/fairseq/tests/distributed/test_bmuf.py/0
{ "file_path": "COCO-LM/fairseq/tests/distributed/test_bmuf.py", "repo_id": "COCO-LM", "token_count": 2873 }
201
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import unittest import tests.utils as test_utils import torch from fairseq.data import ( BacktranslationDataset, LanguagePairDataset,...
COCO-LM/fairseq/tests/test_backtranslation_dataset.py/0
{ "file_path": "COCO-LM/fairseq/tests/test_backtranslation_dataset.py", "repo_id": "COCO-LM", "token_count": 2106 }
202
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import copy import unittest import tests.utils as test_utils import torch from fairseq.criterions.cross_entropy import CrossE...
COCO-LM/fairseq/tests/test_label_smoothing.py/0
{ "file_path": "COCO-LM/fairseq/tests/test_label_smoothing.py", "repo_id": "COCO-LM", "token_count": 2270 }
203
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import contextlib import logging import unittest from io import StringIO from unittest.mock import MagicMock, patch import torch from fairseq...
COCO-LM/fairseq/tests/test_train.py/0
{ "file_path": "COCO-LM/fairseq/tests/test_train.py", "repo_id": "COCO-LM", "token_count": 4760 }
204
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. ## The script is largely adapted from the huggingface transformers library. """ Load SQuAD dataset. """ from __future__ import absolute_import, division, print_function import json import logging import math import collections from io import op...
COCO-LM/huggingface/utils_for_squad.py/0
{ "file_path": "COCO-LM/huggingface/utils_for_squad.py", "repo_id": "COCO-LM", "token_count": 21501 }
205
datadir: /data/CMIP6/HAMMOZ name: 10m_v_component_of_wind cmip_name: vas era_name: v10 run: r1i1p1f1 version: v20190627 res: - 1.40625 # - 5.625
ClimaX/snakemake_configs/HAMMOZ/config_10m_v_component_of_wind.yml/0
{ "file_path": "ClimaX/snakemake_configs/HAMMOZ/config_10m_v_component_of_wind.yml", "repo_id": "ClimaX", "token_count": 76 }
206
year_strings = [ '185001010000-186001010000', '186001010600-187001010000', '187001010600-188001010000', '188001010600-189001010000', '189001010600-190001010000', '190001010600-191001010000', '191001010600-192001010000', '192001010600-193001010000', '193001010600-194001010000', '...
ClimaX/snakemake_configs/TaiESM1/Snakefile/0
{ "file_path": "ClimaX/snakemake_configs/TaiESM1/Snakefile", "repo_id": "ClimaX", "token_count": 1426 }
207
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os from typing import Optional import numpy as np import torch import torchdata.datapipes as dp from pytorch_lightning import LightningDataModule from torch.utils.data import DataLoader, IterableDataset from torchvision.transforms import ...
ClimaX/src/climax/global_forecast/datamodule.py/0
{ "file_path": "ClimaX/src/climax/global_forecast/datamodule.py", "repo_id": "ClimaX", "token_count": 3886 }
208
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import numpy as np import torch from scipy import stats def mse(pred, y, vars, lat=None, mask=None): """Mean squared error Args: pred: [B, L, V*p*p] y: [B, V, H, W] vars: list of variable names """ loss...
ClimaX/src/climax/utils/metrics.py/0
{ "file_path": "ClimaX/src/climax/utils/metrics.py", "repo_id": "ClimaX", "token_count": 4576 }
209
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import torch import importlib def find_model_using_name(model_name): # Given the option --model [modelname], # the file "models/modelname_model.py" # will be imported. model_filename = "models." + model_name + "_model" model...
CoCosNet-v2/models/__init__.py/0
{ "file_path": "CoCosNet-v2/models/__init__.py", "repo_id": "CoCosNet-v2", "token_count": 479 }
210
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from .base_options import BaseOptions class TestOptions(BaseOptions): def initialize(self, parser): BaseOptions.initialize(self, parser) parser.add_argument('--results_dir', type=str, default='./results/', help='saves result...
CoCosNet-v2/options/test_options.py/0
{ "file_path": "CoCosNet-v2/options/test_options.py", "repo_id": "CoCosNet-v2", "token_count": 395 }
211
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import os import cv2 import torch import numpy as np import math import random from PIL import Image from skimage import feature from data.pix2pix_dataset import Pix2pixDataset from data.base_dataset import get_params, get_transform class DeepFa...
CoCosNet/data/deepfashion_dataset.py/0
{ "file_path": "CoCosNet/data/deepfashion_dataset.py", "repo_id": "CoCosNet", "token_count": 3952 }
212
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import torch import torch.nn as nn import torch.nn.functional as F from models.networks.architecture import VGG19 from models.networks.correspondence import VGG19_feature_color_torchversion # Defines the GAN loss which uses either LSGAN or the ...
CoCosNet/models/networks/loss.py/0
{ "file_path": "CoCosNet/models/networks/loss.py", "repo_id": "CoCosNet", "token_count": 2528 }
213
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import os import copy import sys import torch from models.networks.sync_batchnorm import DataParallelWithCallback from models.pix2pix_model import Pix2PixModel from models.networks.generator import EMA import util.util as util class Pix2PixTrain...
CoCosNet/trainers/pix2pix_trainer.py/0
{ "file_path": "CoCosNet/trainers/pix2pix_trainer.py", "repo_id": "CoCosNet", "token_count": 2995 }
214
import random import torch from torch.utils.data import Dataset import os import pickle import logging import json from tqdm import tqdm def _truncate_seq_pair(tokens_a, tokens_b, max_length): """Truncates a sequence pair in place to the maximum length.""" while True: total_length = len(tokens_a) + le...
CodeBERT/CodeExecutor/inference/dataset.py/0
{ "file_path": "CodeBERT/CodeExecutor/inference/dataset.py", "repo_id": "CodeBERT", "token_count": 3399 }
215
import os import torch import logging import argparse import random import json from tqdm import tqdm import multiprocessing import time from itertools import cycle from torch.utils.data import DataLoader, RandomSampler, SequentialSampler from torch.utils.data import ConcatDataset from torch.utils.data.distributed impo...
CodeBERT/CodeReviewer/code/run_finetune_ref.py/0
{ "file_path": "CodeBERT/CodeReviewer/code/run_finetune_ref.py", "repo_id": "CodeBERT", "token_count": 5447 }
216
# Clone Detection (POJ-104) ## Data Download ```bash cd dataset pip install gdown gdown https://drive.google.com/uc?id=0B2i-vWnOu7MxVlJwQXN6eVNONUU tar -xvf programs.tar.gz python preprocess.py cd .. ``` ## Dependency - pip install torch - pip install transformers ## Fine-Tune Here we provide fine-tune settings ...
CodeBERT/UniXcoder/downstream-tasks/clone-detection/POJ-104/README.md/0
{ "file_path": "CodeBERT/UniXcoder/downstream-tasks/clone-detection/POJ-104/README.md", "repo_id": "CodeBERT", "token_count": 520 }
217
# Code Summarization ## Data Download ```bash wget https://github.com/microsoft/CodeXGLUE/raw/main/Code-Text/code-to-text/dataset.zip unzip dataset.zip rm dataset.zip cd dataset wget https://zenodo.org/record/7857872/files/python.zip wget https://zenodo.org/record/7857872/files/java.zip wget https://zenodo.org/record...
CodeBERT/UniXcoder/downstream-tasks/code-summarization/README.md/0
{ "file_path": "CodeBERT/UniXcoder/downstream-tasks/code-summarization/README.md", "repo_id": "CodeBERT", "token_count": 637 }
218
https://allenai.org/data/strategyqa
CodeT/DIVERSE/data/sqa/README.md/0
{ "file_path": "CodeT/DIVERSE/data/sqa/README.md", "repo_id": "CodeT", "token_count": 13 }
219
.PHONY: clean deps install lint pep8 pyflakes pylint test clean: find . -name '*.pyc' -print0 | xargs -0 rm -f find . -name '*.swp' -print0 | xargs -0 rm -f find . -name '__pycache__' -print0 | xargs -0 rm -rf -rm -rf build dist *.egg-info .eggs deps: pip install -r requirements.txt install: python setup.py in...
Cognitive-Face-Python/Makefile/0
{ "file_path": "Cognitive-Face-Python/Makefile", "repo_id": "Cognitive-Face-Python", "token_count": 230 }
220
#!/usr/bin/env python # -*- coding: utf-8 -*- """ File: test_face_list.py Description: Unittests for Face List section of the Cognitive Face API. """ import uuid import unittest import cognitive_face as CF from . import util class TestFaceList(unittest.TestCase): """Unittests for Face List section.""" def...
Cognitive-Face-Python/cognitive_face/tests/test_face_list.py/0
{ "file_path": "Cognitive-Face-Python/cognitive_face/tests/test_face_list.py", "repo_id": "Cognitive-Face-Python", "token_count": 903 }
221
#!/usr/bin/env python # -*- coding: utf-8 -*- """ File: view.py Description: Base components for Python SDK sample. """ import time import wx import util class MyPanel(wx.Panel): """Base Panel.""" def __init__(self, parent): super(MyPanel, self).__init__(parent) colour_window = wx.SystemSet...
Cognitive-Face-Python/sample/view/base.py/0
{ "file_path": "Cognitive-Face-Python/sample/view/base.py", "repo_id": "Cognitive-Face-Python", "token_count": 4278 }
222
export CUDA_VISIBLE_DEVICES=0 python t5_run_eval.py \ --model_name_or_path ./checkpoint/Com/MainExp_finetune_set1_seed1/checkpoint-50000 \ --subtask Com \ --validation_file test \ --ebatch_size 16 \ --set set1
ContextualSP/abstraction_probing/code/t5_code/Com_MainExp_test.sh/0
{ "file_path": "ContextualSP/abstraction_probing/code/t5_code/Com_MainExp_test.sh", "repo_id": "ContextualSP", "token_count": 84 }
223
description: Adapter MT-NLU Job on AMLK8s target: service: amlk8s # run "amlt target list amlk8s" to list the names of available AMLK8s targets name: itpeusp100cl vc: resrchvc environment: image: python:3.6 registry: docker.io # any public registry can be specified here setup: - pip install -r requi...
ContextualSP/adaptershare/adapter_train.yaml/0
{ "file_path": "ContextualSP/adaptershare/adapter_train.yaml", "repo_id": "ContextualSP", "token_count": 1269 }
224
# coding=utf-8 # Copyright (c) Microsoft. All rights reserved. from data_utils import DataFormat def dump_rows(rows, out_path, data_format): """ output files should have following format :param rows: :param out_path: :return: """ with open(out_path, "w", encoding="utf-8") as out_f: ...
ContextualSP/adaptershare/experiments/common_utils.py/0
{ "file_path": "ContextualSP/adaptershare/experiments/common_utils.py", "repo_id": "ContextualSP", "token_count": 2070 }
225
# coding=utf-8 # Copyright (c) Microsoft. All rights reserved. import torch import math from torch.nn.init import ( uniform, normal, eye, xavier_uniform, xavier_normal, kaiming_uniform, kaiming_normal, orthogonal, ) def linear(x): return x def swish(x): return x * sigmoid(x) ...
ContextualSP/adaptershare/module/common.py/0
{ "file_path": "ContextualSP/adaptershare/module/common.py", "repo_id": "ContextualSP", "token_count": 377 }
226
# Copyright (c) Microsoft. All rights reserved. from copy import deepcopy import torch import logging import random from torch.nn import Parameter from functools import wraps import torch.nn.functional as F from data_utils.task_def import TaskType from data_utils.task_def import EncoderModelType from .loss import stabl...
ContextualSP/adaptershare/mt_dnn/perturbation.py/0
{ "file_path": "ContextualSP/adaptershare/mt_dnn/perturbation.py", "repo_id": "ContextualSP", "token_count": 2597 }
227
################################ # Assumptions: # 1. sql is correct # 2. only table name has alias # 3. only one intersect/union/except # # val: number(float)/string(str)/sql(dict) # col_unit: (agg_id, col_id, isDistinct(bool)) # val_unit: (unit_op, col_unit1, col_unit2) # table_unit: (table_type, col_unit/sql) #...
ContextualSP/awakening_latent_grounding/utils/sql_parser.py/0
{ "file_path": "ContextualSP/awakening_latent_grounding/utils/sql_parser.py", "repo_id": "ContextualSP", "token_count": 11065 }
228
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. # Author: Qian Liu (SivilTaram) # Original Repo: https://github.com/microsoft/ContextualSP import torch.nn as nn import torch.nn.functional as F import torch class AttentionUNet(torch.nn.Module): """ UNet, down sampling & up sampling fo...
ContextualSP/incomplete_utterance_rewriting/src/attn_unet.py/0
{ "file_path": "ContextualSP/incomplete_utterance_rewriting/src/attn_unet.py", "repo_id": "ContextualSP", "token_count": 1952 }
229
from typing import List, Tuple, Dict, Set, Optional from copy import deepcopy from .db_context import SparcDBContext from .grammar import Grammar, Action, C, T from .converter import SQLConverter class SparcWorld: """ World representation for spider dataset. """ def __init__(self, db_context: SparcD...
ContextualSP/interactive_text_to_sql/src/context/world.py/0
{ "file_path": "ContextualSP/interactive_text_to_sql/src/context/world.py", "repo_id": "ContextualSP", "token_count": 1907 }
230
# LEMON This repository contains the code and pre-trained models for our EMNLP2022 Findings paper [LEMON: Language-Based Environment Manipulation via Execution-guided Pre-training](https://arxiv.org/pdf/2201.08081.pdf) Data ------- The data is in the [release](https://github.com/microsoft/ContextualSP/releases/tag/le...
ContextualSP/lemon/README.md/0
{ "file_path": "ContextualSP/lemon/README.md", "repo_id": "ContextualSP", "token_count": 240 }
231
import json import logging import math import numbers import os import platform import resource import sys from collections import MutableMapping from contextlib import contextmanager from IPython.core.display import display, HTML from pyhocon import ConfigFactory from pyhocon import ConfigMissingException from pyhoco...
ContextualSP/lemon/executor/gtd/log.py/0
{ "file_path": "ContextualSP/lemon/executor/gtd/log.py", "repo_id": "ContextualSP", "token_count": 1553 }
232
import copy import numpy as np import pytest import tensorflow as tf from math import exp from numpy.testing import assert_array_almost_equal from gtd.ml.model import TokenEmbedder, MeanSequenceEmbedder, ConcatSequenceEmbedder, CandidateScorer, LSTMSequenceEmbedder, \ SoftCopyScorer, Attention, BidiLSTMSequenceEmb...
ContextualSP/lemon/executor/gtd/tests/ml/test_model.py/0
{ "file_path": "ContextualSP/lemon/executor/gtd/tests/ml/test_model.py", "repo_id": "ContextualSP", "token_count": 8384 }
233
from abc import ABCMeta, abstractproperty, abstractmethod from gtd.utils import cached_property class Domain(object, metaclass=ABCMeta): """Encapsulate all domain-dependent information. To add a new domain, create a subclass of domain (in a separate file) and then add it to the get_domain method below. ...
ContextualSP/lemon/executor/strongsup/domain.py/0
{ "file_path": "ContextualSP/lemon/executor/strongsup/domain.py", "repo_id": "ContextualSP", "token_count": 1061 }
234
class Recipe(object): """Light-weight class that defines the configs to launch types of jobs. These jobs are defined for all datasets given by the datasets property. Args: name (string): The name of the config config_mixins (list[string]): Name of the human-readable configs base...
ContextualSP/lemon/executor/strongsup/results/recipe.py/0
{ "file_path": "ContextualSP/lemon/executor/strongsup/results/recipe.py", "repo_id": "ContextualSP", "token_count": 3317 }
235
import os import pytest from strongsup.predicate import Predicate from strongsup.value import check_denotation from strongsup.tables.graph import TablesKnowledgeGraph from strongsup.tables.executor import TablesPostfixExecutor from strongsup.tables.structure import Date, NeqInfiniteSet, RangeInfiniteSet, GenericDateIn...
ContextualSP/lemon/executor/strongsup/tests/tables/test_executor.py/0
{ "file_path": "ContextualSP/lemon/executor/strongsup/tests/tables/test_executor.py", "repo_id": "ContextualSP", "token_count": 7918 }
236
import os import re from codecs import open import itertools from strongsup.example import DelexicalizedContext from strongsup.evaluation import Evaluation, BernoulliSequenceStat from strongsup.value import check_denotation from strongsup.utils import EOU class Visualizer(object): """Subclass around a Decoder,...
ContextualSP/lemon/executor/strongsup/visualizer.py/0
{ "file_path": "ContextualSP/lemon/executor/strongsup/visualizer.py", "repo_id": "ContextualSP", "token_count": 7099 }
237
#!/bin/bash set -euo pipefail if [[ ! -f ARC-V1-Feb2018.zip ]]; then echo Missing file ARC-V1-Feb2018.zip. echo echo Download it first: https://s3-us-west-2.amazonaws.com/ai2-website/data/ARC-V1-Feb2018.zip exit 1 fi unzip -p ARC-V1-Feb2018.zip ARC-V1-Feb2018-2/ARC-Challenge/ARC-Challenge-Test.jsonl | jq -r ...
ContextualSP/lemon/propara_evaluator/aristo-leaderboard/arc/data-challenge/build-dummy-predictions.sh/0
{ "file_path": "ContextualSP/lemon/propara_evaluator/aristo-leaderboard/arc/data-challenge/build-dummy-predictions.sh", "repo_id": "ContextualSP", "token_count": 174 }
238
# eQASC This directory has code and data for the eQASC evaluator, as described in the EMNLP 2020 paper [Learning to Explain: Datasets and Models for Identifying Valid Reasoning Chains in Multihop Question-Answering](https://www.semanticscholar.org/paper/Learning-to-Explain%3A-Datasets-and-Models-for-Valid-Jhamtani-Cla...
ContextualSP/lemon/propara_evaluator/aristo-leaderboard/eqasc/README.md/0
{ "file_path": "ContextualSP/lemon/propara_evaluator/aristo-leaderboard/eqasc/README.md", "repo_id": "ContextualSP", "token_count": 603 }
239
from collections import defaultdict from typing import Dict, List, Tuple def sentences_from_sentences_file(sentences_filename: str) -> Dict[int, List[str]]: all_sentences = dict() # type: Dict[Tuple[int, int], str] with open(sentences_filename) as f: for line in f: process_id_str, sentenc...
ContextualSP/lemon/propara_evaluator/aristo-leaderboard/propara/evaluator/process/sentence_file.py/0
{ "file_path": "ContextualSP/lemon/propara_evaluator/aristo-leaderboard/propara/evaluator/process/sentence_file.py", "repo_id": "ContextualSP", "token_count": 316 }
240
#!/bin/bash # This script will test the evaluator, build a docker image, and publish it as # a Beaker image owned by the Leaderboard user. This is meant to be run by AI2 # after making changes to the QASC evaluator. set -e echo -------------------- echo Unit tests echo -------------------- echo set -x python3 test_...
ContextualSP/lemon/propara_evaluator/aristo-leaderboard/qasc/evaluator/publish_for_leaderboard.sh/0
{ "file_path": "ContextualSP/lemon/propara_evaluator/aristo-leaderboard/qasc/evaluator/publish_for_leaderboard.sh", "repo_id": "ContextualSP", "token_count": 432 }
241
<jupyter_start><jupyter_code>import json import numpy as np import os def write(d, f): json.dump(d, f) f.write("\n") # for f in os.listdir("/data_ext/v-xinyupi/PLoGAN/data/gan_corpus/ver_train_src.jsonl"): current_input = None is_gold = [] conclusions = [] last_input = None with open("/data_ext/v-xinyupi/PLoGA...
ContextualSP/logigan/corpus_construction/elastic_search/merge.ipynb/0
{ "file_path": "ContextualSP/logigan/corpus_construction/elastic_search/merge.ipynb", "repo_id": "ContextualSP", "token_count": 1586 }
242