text stringlengths 5 22M | id stringlengths 12 177 | metadata dict | __index_level_0__ int64 0 1.37k |
|---|---|---|---|
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspace_services/databricks/template_schema.json",
"type": "object",
"title": "Azure Databricks",
"description": "Azure Databricks",
"required": [],
"properties": {
"display_name": {
... | AzureTRE/templates/workspace_services/databricks/template_schema.json/0 | {
"file_path": "AzureTRE/templates/workspace_services/databricks/template_schema.json",
"repo_id": "AzureTRE",
"token_count": 7802
} | 133 |
#!/bin/bash
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:3000/api/swagger)" != @("200"|"302") ]]; do
echo "Waiting for web service"
sleep 5
done
if [ -z $GITEA_USERNAME ]; then
echo "Gitea username is not set"
s6-svc -k /etc/s6/gitea
sleep 60
fi
echo "Adding admin user"
e... | AzureTRE/templates/workspace_services/gitea/docker/configure_gitea.sh/0 | {
"file_path": "AzureTRE/templates/workspace_services/gitea/docker/configure_gitea.sh",
"repo_id": "AzureTRE",
"token_count": 504
} | 134 |
#!/usr/bin/with-contenv sh
echo >&2 "starting tomcat"
sed -i "s#port=\"8080\"#port=\"8080\" maxHttpHeaderSize=\"65536\"#" /usr/share/tomcat9/conf/server.xml
sed -i "s#unpackWARs=\"true\" autoDeploy=\"true\">#><Context path=\"guacamole\" docBase=\"${GUACAMOLE_HOME}guacamole.war\"/>#" /usr/share/tomcat9/conf/server.xml
#... | AzureTRE/templates/workspace_services/guacamole/guacamole-server/docker/services/tomcat/run/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/guacamole-server/docker/services/tomcat/run",
"repo_id": "AzureTRE",
"token_count": 268
} | 135 |
output "authentication_callback_uri" {
value = "https://${azurerm_linux_web_app.guacamole.default_hostname}/oauth2/callback"
}
output "web_apps_addresses" {
value = jsonencode(data.azurerm_subnet.web_apps.address_prefixes)
}
output "admin_connection_uri" {
value = "https://${azurerm_linux_web_app.guacamole.defa... | AzureTRE/templates/workspace_services/guacamole/terraform/outputs.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/terraform/outputs.tf",
"repo_id": "AzureTRE",
"token_count": 135
} | 136 |
$DownloadPath = $env:Public + "\Desktop\ReviewData"
mkdir $DownloadPath
az storage blob download-batch -d $DownloadPath -s '"${airlock_request_sas_url}"'
| AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-export-reviewvm/terraform/download_review_data.ps1/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-export-reviewvm/terraform/download_review_data.ps1",
"repo_id": "AzureTRE",
"token_count": 50
} | 137 |
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/hashicorp/azurerm" {
version = "3.41.0"
constraints = "3.41.0"
hashes = [
"h1:Kn7sqPk/YpsvORFEd/zHXa8U7KkVB551DXUMwvqiU0s=",
"zh:123838b581a27499d0a1e3a9804a6f573... | AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-import-reviewvm/terraform/.terraform.lock.hcl/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-import-reviewvm/terraform/.terraform.lock.hcl",
"repo_id": "AzureTRE",
"token_count": 1922
} | 138 |
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
# Uncomment this line to see each command for debugging (careful: this will show secrets!)
# set -o xtrace
secret_name=$1
keyvault_name=$2
username=$3
resource_id=$4
password="$(LC_ALL=C tr -dc 'A-Za-z0-9_%@' </dev/urandom | head -c 16 ; echo)"
secret_value="... | AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/reset_password.sh/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/reset_password.sh",
"repo_id": "AzureTRE",
"token_count": 205
} | 139 |
#!/bin/bash
set -o errexit
set -o pipefail
set -o nounset
# Uncomment this line to see each command for debugging
# set -o xtrace
# Delete any existing VM Extensions befroe a VM gets deleted.
# This is needed to work around bug https://github.com/hashicorp/terraform-provider-azurerm/issues/6098
MGMT_RESOURCE_GROUP_... | AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/delete_vm_extensions.sh/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/delete_vm_extensions.sh",
"repo_id": "AzureTRE",
"token_count": 398
} | 140 |
# syntax=docker/dockerfile-upstream:1.4.0
FROM --platform=linux/amd64 debian:bullseye-slim
# PORTER_INIT
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
# Git is required for terraform_azurerm_environment_configuration
RUN --mount... | AzureTRE/templates/workspace_services/health-services/Dockerfile.tmpl/0 | {
"file_path": "AzureTRE/templates/workspace_services/health-services/Dockerfile.tmpl",
"repo_id": "AzureTRE",
"token_count": 223
} | 141 |
#!/bin/bash
set -e
acr_domain_suffix=$(az cloud show --query suffixes.acrLoginServerEndpoint --output tsv)
porter install tre-service-azureml --reference "${MGMT_ACR_NAME}${acr_domain_suffix}/tre-service-azureml:v0.1.9" \
--cred ./arm_auth_local_debugging.json \
--parameter-set ./parameters_service_azureml.js... | AzureTRE/templates/workspace_services/innereye/install_service_azureml.sh/0 | {
"file_path": "AzureTRE/templates/workspace_services/innereye/install_service_azureml.sh",
"repo_id": "AzureTRE",
"token_count": 128
} | 142 |
locals {
short_service_id = substr(var.tre_resource_id, -4, -1)
short_workspace_id = substr(var.workspace_id, -4, -1)
core_resource_group_name = "rg-${var.tre_id}"
workspace_resource_name_suffix = "${var.tre_id}-ws-${local.short_workspace_id}"
service_resource_name_suffix ... | AzureTRE/templates/workspace_services/mlflow/terraform/locals.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/mlflow/terraform/locals.tf",
"repo_id": "AzureTRE",
"token_count": 727
} | 143 |
resource "random_password" "password" {
length = 20
min_upper = 2
min_lower = 2
min_numeric = 2
min_special = 2
}
resource "azurerm_mysql_flexible_server" "mysql" {
name = "mysql-${local.service_resource_name_suffix}"
resource_group_name = data.azurerm_resource_g... | AzureTRE/templates/workspace_services/mysql/terraform/mysql.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/mysql/terraform/mysql.tf",
"repo_id": "AzureTRE",
"token_count": 1086
} | 144 |
-- This gives each new user access to all sources plus 'Atlas User' role.
CREATE OR REPLACE FUNCTION function_default_user_roles() RETURNS TRIGGER AS
$BODY$
BEGIN
INSERT INTO webapi.sec_user_role (role_id, user_id)
SELECT r.id as role_id, new.id as user_id
FROM webapi.sec_role as r
WHERE r.name LIKE 'S... | AzureTRE/templates/workspace_services/ohdsi/sql/atlas_default_roles.sql/0 | {
"file_path": "AzureTRE/templates/workspace_services/ohdsi/sql/atlas_default_roles.sql",
"repo_id": "AzureTRE",
"token_count": 256
} | 145 |
output "connection_uri" {
value = local.atlas_ui_url
description = "Atlas Endpoint"
precondition {
condition = local.atlas_ui_fqdn == azurerm_linux_web_app.atlas_ui.default_hostname
error_message = "Computed FQDN is different than actual one."
}
}
output "webapi_uri" {
value = local.... | AzureTRE/templates/workspace_services/ohdsi/terraform/outputs.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/ohdsi/terraform/outputs.tf",
"repo_id": "AzureTRE",
"token_count": 287
} | 146 |
---
schemaVersion: 1.0.0
name: tre-workspace-base
version: 1.5.3
description: "A base Azure TRE workspace"
dockerfile: Dockerfile.tmpl
registry: azuretre
credentials:
# Credentials for interacting with the AAD Auth tenant
- name: auth_client_id
env: AUTH_CLIENT_ID
- name: auth_client_secret
env: AUTH_CLI... | AzureTRE/templates/workspaces/base/porter.yaml/0 | {
"file_path": "AzureTRE/templates/workspaces/base/porter.yaml",
"repo_id": "AzureTRE",
"token_count": 4555
} | 147 |
locals {
short_workspace_id = substr(var.tre_resource_id, -4, -1)
app_insights_name = "appi-${var.tre_id}-ws-${local.short_workspace_id}"
}
| AzureTRE/templates/workspaces/base/terraform/azure-monitor/locals.tf/0 | {
"file_path": "AzureTRE/templates/workspaces/base/terraform/azure-monitor/locals.tf",
"repo_id": "AzureTRE",
"token_count": 65
} | 148 |
resource "azurerm_private_dns_zone_virtual_network_link" "azurewebsites" {
name = "azurewebsites-link-${azurerm_virtual_network.ws.name}"
resource_group_name = local.core_resource_group_name
private_dns_zone_name = data.azurerm_private_dns_zone.azurewebsites.name
virtual_network_id = azure... | AzureTRE/templates/workspaces/base/terraform/network/zone_links.tf/0 | {
"file_path": "AzureTRE/templates/workspaces/base/terraform/network/zone_links.tf",
"repo_id": "AzureTRE",
"token_count": 2725
} | 149 |
import { FontWeights, getTheme, IButtonStyles, IconButton, IIconProps, Link, mergeStyleSets, Modal } from "@fluentui/react";
import React, { useState } from "react";
interface ComplexPropertyModalProps {
val: any,
title: string
};
export const ComplexPropertyModal: React.FunctionComponent<ComplexPropertyModalProps... | AzureTRE/ui/app/src/components/shared/ComplexItemDisplay.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/shared/ComplexItemDisplay.tsx",
"repo_id": "AzureTRE",
"token_count": 1620
} | 150 |
import { IStackStyles, Spinner, SpinnerSize, Stack } from "@fluentui/react";
import React, { useEffect, useContext, useState } from 'react';
import { useParams } from 'react-router-dom';
import { HttpMethod, useAuthApiCall } from '../../hooks/useAuthApiCall';
import { HistoryItem, Resource } from '../../models/resource... | AzureTRE/ui/app/src/components/shared/ResourceHistoryList.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/shared/ResourceHistoryList.tsx",
"repo_id": "AzureTRE",
"token_count": 1413
} | 151 |
import { DefaultButton, Dialog, DialogFooter, DocumentCard, DocumentCardActivity, DocumentCardDetails, DocumentCardTitle, DocumentCardType, FontIcon, getTheme, IStackItemStyles, IStackStyles, IStackTokens, mergeStyles, MessageBar, MessageBarType, Modal, Panel, PanelType, Persona, PersonaSize, PrimaryButton, Spinner, Sp... | AzureTRE/ui/app/src/components/shared/airlock/AirlockViewRequest.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/shared/airlock/AirlockViewRequest.tsx",
"repo_id": "AzureTRE",
"token_count": 6788
} | 152 |
import React, { useContext, useEffect, useState } from 'react';
import { Route, Routes, useNavigate, useParams } from 'react-router-dom';
import { ApiEndpoint } from '../../models/apiEndpoints';
import { useAuthApiCall, HttpMethod } from '../../hooks/useAuthApiCall';
import { UserResource } from '../../models/userResou... | AzureTRE/ui/app/src/components/workspaces/WorkspaceServiceItem.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/workspaces/WorkspaceServiceItem.tsx",
"repo_id": "AzureTRE",
"token_count": 3454
} | 153 |
import { ResourceType } from "./resourceType";
import { User } from "./user";
export interface Operation {
id: string,
resourceId: string,
resourcePath: string,
resourceVersion: number,
status: string,
action: string,
message: string,
createdWhen: number,
updatedWhen: number,
us... | AzureTRE/ui/app/src/models/operation.ts/0 | {
"file_path": "AzureTRE/ui/app/src/models/operation.ts",
"repo_id": "AzureTRE",
"token_count": 470
} | 154 |
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCa... | AzureTRE/ui/app/tsconfig.json/0 | {
"file_path": "AzureTRE/ui/app/tsconfig.json",
"repo_id": "AzureTRE",
"token_count": 284
} | 155 |
# BioGPT
This repository contains the implementation of [BioGPT: Generative Pre-trained Transformer for Biomedical Text Generation and Mining](https://academic.oup.com/bib/advance-article/doi/10.1093/bib/bbac409/6713511?guestAccessKey=a66d9b5d-4f83-4017-bb52-405815c907b9), by Renqian Luo, Liai Sun, Yingce Xia, Tao Qin,... | BioGPT/README.md/0 | {
"file_path": "BioGPT/README.md",
"repo_id": "BioGPT",
"token_count": 3995
} | 156 |
FORMAT=$1
GOLD_FILE=$2
PREDICTION_FILE=$3
java -cp bc5cdr_eval.jar ncbi.bc5cdr_eval.Evaluate id Disease $FORMAT $GOLD_FILE $PREDICTION_FILE | grep -v INFO
# java -cp bc5cdr_eval.jar ncbi.bc5cdr_eval.Evaluate id Disease $FORMAT $GOLD_FILE $PREDICTION_FILE
| BioGPT/data/BC5CDR/raw/BC5CDR_Evaluation-0.0.3/eval_id.sh/0 | {
"file_path": "BioGPT/data/BC5CDR/raw/BC5CDR_Evaluation-0.0.3/eval_id.sh",
"repo_id": "BioGPT",
"token_count": 113
} | 157 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
SAVE_DIR=../../checkpoints/DC-HoC-BioGPT
mkdir -p ${SAVE_DIR}
fairseq-train \
../../data/HoC/ansis-bin --save-dir ${SAVE_DIR} \
--user-dir ../../src \
--finetune-from-model ../../checkpoints/Pre-trained-BioGPT/checkpoint.pt \
--t... | BioGPT/examples/DC-HoC/train.sh/0 | {
"file_path": "BioGPT/examples/DC-HoC/train.sh",
"repo_id": "BioGPT",
"token_count": 370
} | 158 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import re
import json
import sys
import os
pred_file = sys.argv[1]
gold_file = sys.argv[2]
pmids_file = sys.argv[3]
def normalize_name(s: str):
s = s.strip()
# normalize roman type id at end of string
num2roman = {"0": "0", "1": "I... | BioGPT/examples/RE-DDI/hard_match_evaluation.py/0 | {
"file_path": "BioGPT/examples/RE-DDI/hard_match_evaluation.py",
"repo_id": "BioGPT",
"token_count": 3936
} | 159 |
# Speedup Benchmark vs Vendor Libraries
This part presents a benchmark comparison between our custom library, BitBLAS, and various vendor libraries (cuBLAS, CUTLASS, bitsandbytes, faster-transformer, tensorrt-llm, vLLM, and Marlin) across different matrix operation types (GEMM, GEMV) and data formats (float16xfloat16,... | BitBLAS/benchmark/README.md/0 | {
"file_path": "BitBLAS/benchmark/README.md",
"repo_id": "BitBLAS",
"token_count": 2163
} | 160 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from logging import getLogger
import numpy as np
import torch
import torch.nn as nn
from typing import List, Union, Literal, Optional
logger = getLogger(__name__)
try:
import bitblas # noqa: F401
except ImportError as e:
bitblas_impo... | BitBLAS/integration/pytorch/bitblas_linear.py/0 | {
"file_path": "BitBLAS/integration/pytorch/bitblas_linear.py",
"repo_id": "BitBLAS",
"token_count": 1809
} | 161 |
# 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/base/common_schedules.py/0 | {
"file_path": "BitBLAS/python/bitblas/base/common_schedules.py",
"repo_id": "BitBLAS",
"token_count": 1634
} | 162 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from typing import Dict, List, Tuple, Set, Mapping
from tvm.tir.schedule.schedule import BlockRV
from tvm.ir import structural_equal
from tvm import arith, tir
class Statement:
def __init__(self, block_analyzer, block: BlockRV):
sel... | BitBLAS/python/bitblas/base/roller/shape_inference/tir.py/0 | {
"file_path": "BitBLAS/python/bitblas/base/roller/shape_inference/tir.py",
"repo_id": "BitBLAS",
"token_count": 7689
} | 163 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# pylint: disable=missing-docstring, invalid-name
"""A GEMM schedule rule for GPU operators."""
from dataclasses import dataclass
from typing import Optional
from tvm import tir
from tvm.target import Target
from tvm.tir.stmt import ForKind
fro... | BitBLAS/python/bitblas/gpu/matmul.py/0 | {
"file_path": "BitBLAS/python/bitblas/gpu/matmul.py",
"repo_id": "BitBLAS",
"token_count": 7385
} | 164 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# pre-transformed tir expression of matmul
import tvm
from tvm import te, DataType
from tvm.tir import IndexMap
from bitblas.ops.operator import TransformKind
from bitblas.gpu.matmul_analysis import get_propagate_map
from bitblas.quantization impo... | BitBLAS/python/bitblas/ops/impl/matmul_dequantize_impl.py/0 | {
"file_path": "BitBLAS/python/bitblas/ops/impl/matmul_dequantize_impl.py",
"repo_id": "BitBLAS",
"token_count": 11350
} | 165 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import sys
import inspect
import pytest
from bitblas.base import DefaultPolicy, TensorCorePolicy
from bitblas.gpu.matmul_analysis import get_tensorized_func_and_tags
# pytest.main() wrapper to allow running single test file
def main():
test_... | BitBLAS/python/bitblas/testing/__init__.py/0 | {
"file_path": "BitBLAS/python/bitblas/testing/__init__.py",
"repo_id": "BitBLAS",
"token_count": 300
} | 166 |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#include <gtest/gtest.h>
#include <stdio.h>
#include <cuda_runtime.h>
#include <cuda_fp16.h>
#include "fast_decoding.hpp"
#define cudaCheckLastError(ans) \
{ \
gpuAssert((ans), _... | BitBLAS/testing/cpp/lop3_type_conversion/lowprecision_to_int8.cu/0 | {
"file_path": "BitBLAS/testing/cpp/lop3_type_conversion/lowprecision_to_int8.cu",
"repo_id": "BitBLAS",
"token_count": 5625
} | 167 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import numpy as np
import pytest
import tvm
import tvm.testing
from tvm.ir import assert_structural_equal
from tvm.runtime import const
from tvm.tir import IndexMap, IntImm, floordiv, floormod
from tvm import tir
index_map = IndexMap.from_func(la... | BitBLAS/testing/python/weight_only/index_map_deduce.py/0 | {
"file_path": "BitBLAS/testing/python/weight_only/index_map_deduce.py",
"repo_id": "BitBLAS",
"token_count": 261
} | 168 |
date ; hostname ; pwd
EXP_NODES=1
EXP_IS=384
EXP_PGB=8
EXP_PGEB=64
EXP_LR=3e-6
EXP_BS=64
EXP_ME=5
EXP_WS=0.06
EXP_WD=0.01
EXP_LMH=10
EXP_LMC=5
EXP_THL=2
EXP_HHS=2
EXP_LP=BridgeTower_pt_base.ckpt
EXP_RGM=blip_randaug_wc
export MASTER_ADDR=$HOSTNAME
export MASTER_PORT=19800
export NODE_RANK=0
PREFIX_NAME="ftfpt"
ech... | BridgeTower/scripts/ftfpt_base_snlive.sh/0 | {
"file_path": "BridgeTower/scripts/ftfpt_base_snlive.sh",
"repo_id": "BridgeTower",
"token_count": 603
} | 169 |
from ..datasets import ConceptualCaptionDataset
from .datamodule_base import BaseDataModule
class ConceptualCaptionDataModule(BaseDataModule):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@property
def dataset_cls(self):
return ConceptualCaptionDataset
@prop... | BridgeTower/src/datamodules/conceptual_caption_datamodule.py/0 | {
"file_path": "BridgeTower/src/datamodules/conceptual_caption_datamodule.py",
"repo_id": "BridgeTower",
"token_count": 143
} | 170 |
from .base_dataset import BaseDataset
class SNLIDataset(BaseDataset):
def __init__(self, *args, split="", **kwargs):
assert split in ["train", "val", "test"]
self.split = split
if split == "train":
names = ["snli_train"]
elif split == "val":
names = ["snli_... | BridgeTower/src/datasets/snli_dataset.py/0 | {
"file_path": "BridgeTower/src/datasets/snli_dataset.py",
"repo_id": "BridgeTower",
"token_count": 532
} | 171 |
# Modify from the above code repository
# https://github.com/salesforce/ALBEF/blob/HEAD/models/vit.py
# https://github.com/dandelin/ViLT/blob/HEAD/vilt/modules/vision_transformer.py
# https://github.com/rwightman/pytorch-image-models/blob/master/timm/models/vision_transformer.py
import torch
import torch.nn as nn
impo... | BridgeTower/src/modules/vit_model.py/0 | {
"file_path": "BridgeTower/src/modules/vit_model.py",
"repo_id": "BridgeTower",
"token_count": 14567
} | 172 |
import json
import pandas as pd
import pyarrow as pa
import random
import os
from tqdm import tqdm
from glob import glob
from collections import defaultdict, Counter
from glossary import normalize_word
def path2rest(path, split, annotations, label2ans):
iid = int(path.split("/")[-1][:-4])
with open(path, "r... | BridgeTower/src/utils/write_vgqa.py/0 | {
"file_path": "BridgeTower/src/utils/write_vgqa.py",
"repo_id": "BridgeTower",
"token_count": 3444
} | 173 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
import numpy as np
import skimage.io as io
# from face_sdk import FaceDetection
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
from skimage.transform import SimilarityTransform
from skimage.transform import... | Bringing-Old-Photos-Back-to-Life/Face_Detection/align_warp_back_multiple_dlib_HR.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/Face_Detection/align_warp_back_multiple_dlib_HR.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 6102
} | 174 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
import models.networks as networks
import util.util as util
class Pix2PixModel(torch.nn.Module):
@staticmethod
def modify_commandline_options(parser, is_train):
networks.modify_commandline_options(parser, is_train)
... | Bringing-Old-Photos-Back-to-Life/Face_Enhancement/models/pix2pix_model.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/Face_Enhancement/models/pix2pix_model.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 4446
} | 175 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch.utils.data
import random
from data.base_data_loader import BaseDataLoader
from data import online_dataset_for_old_photos as dts_ray_bigfile
def CreateDataset(opt):
dataset = None
if opt.training_dataset=='domain_A' or opt.t... | Bringing-Old-Photos-Back-to-Life/Global/data/custom_dataset_data_loader.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/Global/data/custom_dataset_data_loader.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 567
} | 176 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import numpy as np
import torch
import os
from torch.autograd import Variable
from util.image_pool import ImagePool
from .base_model import BaseModel
from . import networks
class Pix2PixHDModel(BaseModel):
def name(self):
return 'Pi... | Bringing-Old-Photos-Back-to-Life/Global/models/pix2pixHD_model_DA.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/Global/models/pix2pixHD_model_DA.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 7965
} | 177 |
---
- name: Bringing-Old-Photos-Back-to-Life
hosts: all
gather_facts: no
# Succesfully tested on Ubuntu 18.04\20.04 and Debian 10
pre_tasks:
- name: install packages
package:
name:
- python3
- python3-pip
- python3-venv
- git
- unzip
- tar
- ... | Bringing-Old-Photos-Back-to-Life/ansible.yaml/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/ansible.yaml",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 1453
} | 178 |
"""
This is an example using CLAPCAP for audio captioning.
"""
from msclap import CLAP
# Load and initialize CLAP
clap_model = CLAP(version = 'clapcap', use_cuda=False)
#Load audio files
audio_files = ['audio_file']
# Generate captions for the recording
captions = clap_model.generate_caption(audio_files, resample=Tr... | CLAP/examples/audio_captioning.py/0 | {
"file_path": "CLAP/examples/audio_captioning.py",
"repo_id": "CLAP",
"token_count": 211
} | 179 |
import argparse
import yaml
import sys
def read_config_as_args(config_path,args=None,is_config_str=False):
return_dict = {}
if config_path is not None:
if is_config_str:
yml_config = yaml.load(config_path, Loader=yaml.FullLoader)
else:
with open(config_path, "r") as f:
... | CLAP/msclap/models/utils.py/0 | {
"file_path": "CLAP/msclap/models/utils.py",
"repo_id": "CLAP",
"token_count": 422
} | 180 |
# COCO-LM
This repository contains the scripts for fine-tuning COCO-LM pretrained models on GLUE and SQuAD 2.0 benchmarks.
Paper: [COCO-LM: Correcting and Contrasting Text Sequences for Language Model Pretraining](https://arxiv.org/abs/2102.08473)
<img src="./coco-lm.png" width="1000px"></img>
## Overview
We provi... | COCO-LM/README.md/0 | {
"file_path": "COCO-LM/README.md",
"repo_id": "COCO-LM",
"token_count": 1265
} | 181 |
.. role:: hidden
:class: hidden-section
.. _Learning Rate Schedulers:
Learning Rate Schedulers
========================
Learning Rate Schedulers update the learning rate over the course of training.
Learning rates can be updated after each update via :func:`step_update` or at
epoch boundaries via :func:`step`.
... | COCO-LM/fairseq/docs/lr_scheduler.rst/0 | {
"file_path": "COCO-LM/fairseq/docs/lr_scheduler.rst",
"repo_id": "COCO-LM",
"token_count": 386
} | 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.
import math
from dataclasses import dataclass
import torch.nn.functional as F
from fairseq import metrics, utils
from fairseq.criterions impo... | COCO-LM/fairseq/examples/adaptive_span/adaptive_span_loss.py/0 | {
"file_path": "COCO-LM/fairseq/examples/adaptive_span/adaptive_span_loss.py",
"repo_id": "COCO-LM",
"token_count": 1801
} | 183 |
#!/bin/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.
PY_BIN_ROOT=
# PyPI dependency
${PY_BIN_ROOT}pip install sentencepiece sacremoses
# Get data
if [ ! -d "data" ]; then
mkdir d... | COCO-LM/fairseq/examples/byte_level_bpe/get_data.sh/0 | {
"file_path": "COCO-LM/fairseq/examples/byte_level_bpe/get_data.sh",
"repo_id": "COCO-LM",
"token_count": 762
} | 184 |
# Cross-Lingual Language Model Pre-training
Below are some details for training Cross-Lingual Language Models (XLM) - similar to the ones presented in [Lample & Conneau, 2019](https://arxiv.org/pdf/1901.07291.pdf) - in Fairseq. The current implementation only supports the Masked Language Model (MLM) from the paper abo... | COCO-LM/fairseq/examples/cross_lingual_language_model/README.md/0 | {
"file_path": "COCO-LM/fairseq/examples/cross_lingual_language_model/README.md",
"repo_id": "COCO-LM",
"token_count": 975
} | 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 torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import options, utils
from fairseq.models import (
Fairs... | COCO-LM/fairseq/examples/laser/laser_src/laser_lstm.py/0 | {
"file_path": "COCO-LM/fairseq/examples/laser/laser_src/laser_lstm.py",
"repo_id": "COCO-LM",
"token_count": 10327
} | 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 .models import linformer_roberta # noqa
| COCO-LM/fairseq/examples/linformer/linformer_src/__init__.py/0 | {
"file_path": "COCO-LM/fairseq/examples/linformer/linformer_src/__init__.py",
"repo_id": "COCO-LM",
"token_count": 60
} | 187 |
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
if [ -z $WORKDIR_ROOT ] ;
then
echo "please specify your working directory root in environment variable... | COCO-LM/fairseq/examples/multilingual/data_scripts/download_ML50_v1.sh/0 | {
"file_path": "COCO-LM/fairseq/examples/multilingual/data_scripts/download_ML50_v1.sh",
"repo_id": "COCO-LM",
"token_count": 296
} | 188 |
#!/bin/bash
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
path_2_data=$1 # <path to data> which contains binarized data for each directions
lang_list=$2 # <path to a f... | COCO-LM/fairseq/examples/multilingual/finetune_multilingual_model.sh/0 | {
"file_path": "COCO-LM/fairseq/examples/multilingual/finetune_multilingual_model.sh",
"repo_id": "COCO-LM",
"token_count": 509
} | 189 |
# Pay Less Attention with Lightweight and Dynamic Convolutions (Wu et al., 2019)
This page contains pointers to pre-trained models as well as instructions on how to train new models for [our paper](https://arxiv.org/abs/1901.10430).
## Citation:
```bibtex
@inproceedings{wu2018pay,
title = {Pay Less Attention with L... | COCO-LM/fairseq/examples/pay_less_attention_paper/README.md/0 | {
"file_path": "COCO-LM/fairseq/examples/pay_less_attention_paper/README.md",
"repo_id": "COCO-LM",
"token_count": 4319
} | 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 json
import os
import numpy as np
import torch
from fairseq.data import (
Dictionary,
IdDataset,
ListDataset,
NestedDi... | COCO-LM/fairseq/examples/roberta/commonsense_qa/commonsense_qa_task.py/0 | {
"file_path": "COCO-LM/fairseq/examples/roberta/commonsense_qa/commonsense_qa_task.py",
"repo_id": "COCO-LM",
"token_count": 3041
} | 191 |
# Scaling Neural Machine Translation (Ott et al., 2018)
This page includes instructions for reproducing results from the paper [Scaling Neural Machine Translation (Ott et al., 2018)](https://arxiv.org/abs/1806.00187).
## Pre-trained models
Model | Description | Dataset | Download
---|---|---|---
`transformer.wmt14.e... | COCO-LM/fairseq/examples/scaling_nmt/README.md/0 | {
"file_path": "COCO-LM/fairseq/examples/scaling_nmt/README.md",
"repo_id": "COCO-LM",
"token_count": 1960
} | 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 importlib
import os
for file in os.listdir(os.path.dirname(__file__)):
if file.endswith(".py") and not file.startswith("_"):
... | COCO-LM/fairseq/examples/simultaneous_translation/models/__init__.py/0 | {
"file_path": "COCO-LM/fairseq/examples/simultaneous_translation/models/__init__.py",
"repo_id": "COCO-LM",
"token_count": 174
} | 193 |
import importlib
import os
for file in os.listdir(os.path.dirname(__file__)):
if file.endswith(".py") and not file.startswith("_"):
task_name = file[: file.find(".py")]
importlib.import_module("examples.speech_recognition.tasks." + task_name)
| COCO-LM/fairseq/examples/speech_recognition/tasks/__init__.py/0 | {
"file_path": "COCO-LM/fairseq/examples/speech_recognition/tasks/__init__.py",
"repo_id": "COCO-LM",
"token_count": 108
} | 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 json
import os
from fairseq import checkpoint_utils, utils, tasks
from . import DEFAULT_EOS, GET, SEND
from .agent import Agent
cla... | COCO-LM/fairseq/examples/speech_to_text/simultaneous_translation/agents/simul_trans_agent.py/0 | {
"file_path": "COCO-LM/fairseq/examples/speech_to_text/simultaneous_translation/agents/simul_trans_agent.py",
"repo_id": "COCO-LM",
"token_count": 2930
} | 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
from dataclasses import dataclass, field
from typing import List, Optional, Tuple
import torch
from fairseq import u... | COCO-LM/fairseq/examples/truncated_bptt/truncated_bptt_lm_task.py/0 | {
"file_path": "COCO-LM/fairseq/examples/truncated_bptt/truncated_bptt_lm_task.py",
"repo_id": "COCO-LM",
"token_count": 4667
} | 196 |
# @package _group_
common:
fp16: true
log_format: json
log_interval: 200
checkpoint:
save_interval_updates: 25000
keep_interval_updates: 1
no_epoch_checkpoints: true
task:
_name: audio_pretraining
data: ???
max_sample_size: 250000
min_sample_size: 32000
normalize: false
dataset:
num_workers:... | COCO-LM/fairseq/examples/wav2vec/config/pretraining/wav2vec2_base_librispeech.yaml/0 | {
"file_path": "COCO-LM/fairseq/examples/wav2vec/config/pretraining/wav2vec2_base_librispeech.yaml",
"repo_id": "COCO-LM",
"token_count": 422
} | 197 |
# 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 numpy as np
import torch
from fairseq.data import Dictionary, FairseqDataset
from fairseq.tasks import LegacyFairseqTas... | COCO-LM/fairseq/fairseq/benchmark/dummy_mt.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/benchmark/dummy_mt.py",
"repo_id": "COCO-LM",
"token_count": 1684
} | 198 |
# @package _group_
activation_fn: "relu"
dropout: 0.1
attention_dropout: 0.1
activation_dropout: 0.0
relu_dropout: 0.0
decoder_embed_dim: 512
decoder_output_dim: 512
decoder_input_dim: 512
decoder_ffn_embed_dim: 4096
decoder_layers: 12
decoder_attention_heads: 16
decoder_normalize_before: true
no_decoder_final_norm: tr... | COCO-LM/fairseq/fairseq/config/model/transformer_lm/transformer_lm_gbw.yaml/0 | {
"file_path": "COCO-LM/fairseq/fairseq/config/model/transformer_lm/transformer_lm_gbw.yaml",
"repo_id": "COCO-LM",
"token_count": 389
} | 199 |
# 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 examples.simultaneous_translation.utils.latency import LatencyTraining
from fairseq.criterions import register_criterion
from fairseq.cri... | COCO-LM/fairseq/fairseq/criterions/label_smoothed_cross_entropy_latency_augmented.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/criterions/label_smoothed_cross_entropy_latency_augmented.py",
"repo_id": "COCO-LM",
"token_count": 1785
} | 200 |
import numpy as np
from fairseq.data.audio.feature_transforms import (
AudioFeatureTransform,
register_audio_feature_transform,
)
@register_audio_feature_transform("global_cmvn")
class GlobalCMVN(AudioFeatureTransform):
"""Global CMVN (cepstral mean and variance normalization). The global mean
and var... | COCO-LM/fairseq/fairseq/data/audio/feature_transforms/global_cmvn.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/audio/feature_transforms/global_cmvn.py",
"repo_id": "COCO-LM",
"token_count": 391
} | 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 importlib
import os
from fairseq import registry
build_tokenizer, register_tokenizer, TOKENIZER_REGISTRY, _ = registry.setup_regist... | COCO-LM/fairseq/fairseq/data/encoders/__init__.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/encoders/__init__.py",
"repo_id": "COCO-LM",
"token_count": 264
} | 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 logging
import numpy as np
import torch.utils.data
from fairseq.data import data_utils
logger = logging.getLogger(__name__)
class Ep... | COCO-LM/fairseq/fairseq/data/fairseq_dataset.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/fairseq_dataset.py",
"repo_id": "COCO-LM",
"token_count": 3132
} | 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.
from collections import OrderedDict
from typing import Callable, Dict, List
import numpy as np
from . import FairseqDataset
def uniform_sa... | COCO-LM/fairseq/fairseq/data/multi_corpus_sampled_dataset.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/multi_corpus_sampled_dataset.py",
"repo_id": "COCO-LM",
"token_count": 2181
} | 204 |
# 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 numpy as np
from . import FairseqDataset
class RawLabelDataset(FairseqDataset):
def __init__(self, labels):
... | COCO-LM/fairseq/fairseq/data/raw_label_dataset.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/raw_label_dataset.py",
"repo_id": "COCO-LM",
"token_count": 662
} | 205 |
# cython: language_level=3
# 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
import torch
from itertools import chain
from libc.math cimport ceil
cimport cython
cimport num... | COCO-LM/fairseq/fairseq/data/token_block_utils_fast.pyx/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/token_block_utils_fast.pyx",
"repo_id": "COCO-LM",
"token_count": 3387
} | 206 |
# 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.
"""
Utilities for working with the local dataset cache.
This file is adapted from `AllenNLP <https://github.com/allenai/allennlp>`_.
and `hugg... | COCO-LM/fairseq/fairseq/file_utils.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/file_utils.py",
"repo_id": "COCO-LM",
"token_count": 4762
} | 207 |
# 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 typing import Dict, List, NamedTuple, Optional
import torch
import torch.nn as nn
from torch import Tensor
EncoderOut = NamedTuple(
... | COCO-LM/fairseq/fairseq/models/fairseq_encoder.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/models/fairseq_encoder.py",
"repo_id": "COCO-LM",
"token_count": 1262
} | 208 |
# 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.
"""
This file implements:
Ghazvininejad, Marjan, et al.
"Constant-time machine translation with conditional masked language models."
arXiv pre... | COCO-LM/fairseq/fairseq/models/nat/cmlm_transformer.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/models/nat/cmlm_transformer.py",
"repo_id": "COCO-LM",
"token_count": 2846
} | 209 |
# 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 .berard import * # noqa
from .convtransformer import * # noqa
from .s2t_transformer import * # noqa
| COCO-LM/fairseq/fairseq/models/speech_to_text/__init__.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/models/speech_to_text/__init__.py",
"repo_id": "COCO-LM",
"token_count": 83
} | 210 |
# 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 argparse import Namespace
import contextlib
import copy
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn... | COCO-LM/fairseq/fairseq/models/wav2vec/wav2vec2_asr.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/models/wav2vec/wav2vec2_asr.py",
"repo_id": "COCO-LM",
"token_count": 9946
} | 211 |
/**
* 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.
*/
#include <ATen/ATen.h>
#include <c10/cuda/CUDAStream.h>
#include <cuda.h>
#include <cuda_fp16.h>
#include <cuda_runtime.h>
#inc... | COCO-LM/fairseq/fairseq/modules/dynamicconv_layer/dynamicconv_cuda.cuh/0 | {
"file_path": "COCO-LM/fairseq/fairseq/modules/dynamicconv_layer/dynamicconv_cuda.cuh",
"repo_id": "COCO-LM",
"token_count": 663
} | 212 |
/**
* 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.
*/
#include <torch/extension.h>
#include <vector>
std::vector<at::Tensor> lightconv_cuda_forward(
at::Tensor input,
at::Tens... | COCO-LM/fairseq/fairseq/modules/lightconv_layer/lightconv_cuda.cpp/0 | {
"file_path": "COCO-LM/fairseq/fairseq/modules/lightconv_layer/lightconv_cuda.cpp",
"repo_id": "COCO-LM",
"token_count": 571
} | 213 |
# 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 as nn
import torch.nn.functional as F
class PQLinear(nn.Module):
"""
Quantized counterpart of nn.Linear... | COCO-LM/fairseq/fairseq/modules/quantization/pq/modules/qlinear.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/modules/quantization/pq/modules/qlinear.py",
"repo_id": "COCO-LM",
"token_count": 1091
} | 214 |
# 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 as nn
from fairseq.modules import TransformerSentenceEncoder
from fairseq.modules.sparse_transformer_sentence_encoder_layer im... | COCO-LM/fairseq/fairseq/modules/sparse_transformer_sentence_encoder.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/modules/sparse_transformer_sentence_encoder.py",
"repo_id": "COCO-LM",
"token_count": 1608
} | 215 |
# 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
import torch
import torch.distributed as dist
from fairseq.dataclass.configs import FairseqBMUFConfi... | COCO-LM/fairseq/fairseq/optim/bmuf.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/optim/bmuf.py",
"repo_id": "COCO-LM",
"token_count": 3121
} | 216 |
# 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 typing import List
import torch.optim.lr_scheduler
from omegaconf import II
from fairseq.datac... | COCO-LM/fairseq/fairseq/optim/lr_scheduler/reduce_lr_on_plateau.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/optim/lr_scheduler/reduce_lr_on_plateau.py",
"repo_id": "COCO-LM",
"token_count": 2249
} | 217 |
# 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, List, Optional
import torch
import torch.nn as nn
from fairseq import search, utils
from fairseq.data im... | COCO-LM/fairseq/fairseq/sequence_generator.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/sequence_generator.py",
"repo_id": "COCO-LM",
"token_count": 19051
} | 218 |
# 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.path as op
from argparse import Namespace
from fairseq.data import Dictionary, encoders
from fairseq.data.audio.spee... | COCO-LM/fairseq/fairseq/tasks/speech_to_text.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/tasks/speech_to_text.py",
"repo_id": "COCO-LM",
"token_count": 2396
} | 219 |
#!/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.
import logging
import os
import sys
from fairseq.dataclass.initialize import add_defaults, hydra_init
from fairseq_... | COCO-LM/fairseq/fairseq_cli/hydra_train.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq_cli/hydra_train.py",
"repo_id": "COCO-LM",
"token_count": 1142
} | 220 |
/**
* From PyTorch:
*
* Copyright (c) 2016- Facebook, Inc (Adam Paszke)
* Copyright (c) 2014- Facebook, Inc (Soumith Chintala)
* Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert)
* Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu)
* Copyright (c) ... | COCO-LM/fairseq/fused_ops/csrc/xentropy/xentropy_kernel.cu/0 | {
"file_path": "COCO-LM/fairseq/fused_ops/csrc/xentropy/xentropy_kernel.cu",
"repo_id": "COCO-LM",
"token_count": 11071
} | 221 |
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import absolute_import, division, print_function, unicode_literals
import argparse
i... | COCO-LM/fairseq/scripts/spm_encode.py/0 | {
"file_path": "COCO-LM/fairseq/scripts/spm_encode.py",
"repo_id": "COCO-LM",
"token_count": 1575
} | 222 |
#!/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 unittest
import numpy as np
import torch
from examples.speech_recognition.data.collaters import Seq2SeqCollater... | COCO-LM/fairseq/tests/speech_recognition/test_collaters.py/0 | {
"file_path": "COCO-LM/fairseq/tests/speech_recognition/test_collaters.py",
"repo_id": "COCO-LM",
"token_count": 982
} | 223 |
#!/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
import tempfile
import unittest
import torch
from fairseq.data.dictionary import Dictionary
from fairs... | COCO-LM/fairseq/tests/test_export.py/0 | {
"file_path": "COCO-LM/fairseq/tests/test_export.py",
"repo_id": "COCO-LM",
"token_count": 1637
} | 224 |
# 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 json
import os
import tempfile
import unittest
from io import StringIO
import torch
from . import test_binaries
c... | COCO-LM/fairseq/tests/test_reproducibility.py/0 | {
"file_path": "COCO-LM/fairseq/tests/test_reproducibility.py",
"repo_id": "COCO-LM",
"token_count": 2595
} | 225 |
# ------------------------------------------
# CSWin Transformer
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# written By Xiaoyi Dong
# ------------------------------------------
from .cswin import *
| CSWin-Transformer/models/__init__.py/0 | {
"file_path": "CSWin-Transformer/models/__init__.py",
"repo_id": "CSWin-Transformer",
"token_count": 48
} | 226 |
seed_everything: 42
# ---------------------------- TRAINER -------------------------------------------
trainer:
default_root_dir: ${oc.env:OUTPUT_DIR,/home/t-tungnguyen/ClimaX/exps/pretrain_climax}
precision: 16
gpus: null
num_nodes: 1
accelerator: gpu
strategy: ddp
min_epochs: 1
max_epochs: 100
e... | ClimaX/configs/pretrain_climax.yaml/0 | {
"file_path": "ClimaX/configs/pretrain_climax.yaml",
"repo_id": "ClimaX",
"token_count": 2267
} | 227 |
# Global Forecasting
::: climax.global_forecast.datamodule
::: climax.global_forecast.module
| ClimaX/docs/reference/global_forecast.md/0 | {
"file_path": "ClimaX/docs/reference/global_forecast.md",
"repo_id": "ClimaX",
"token_count": 32
} | 228 |
datadir: /data/CMIP6/CMCC
name: geopotential
cmip_name: zg
era_name: z
run: r1i1p1f1
res:
- 1.40625
# - 5.625 | ClimaX/snakemake_configs/CMCC/config_geopotential.yml/0 | {
"file_path": "ClimaX/snakemake_configs/CMCC/config_geopotential.yml",
"repo_id": "ClimaX",
"token_count": 61
} | 229 |
datadir: /data/CMIP6/MPI-ESM
server_prefix: http://esgf-data1.llnl.gov/thredds/fileServer/css03_data/CMIP6/CMIP
name: 2m_temperature
cmip_name: tas
era_name: t2m
output_type: 6hrPlevPt
run: r1i1p1f1
version: v20190815
res:
- 1.40625
# - 5.625 | ClimaX/snakemake_configs/MPI-ESM/config_2m_temperature.yml/0 | {
"file_path": "ClimaX/snakemake_configs/MPI-ESM/config_2m_temperature.yml",
"repo_id": "ClimaX",
"token_count": 123
} | 230 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
import numpy as np
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# References:
# timm: https://github.com/rwig... | ClimaX/src/climax/climate_projection/arch.py/0 | {
"file_path": "ClimaX/src/climax/climate_projection/arch.py",
"repo_id": "ClimaX",
"token_count": 2414
} | 231 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import torch
from climax.arch import ClimaX
class RegionalClimaX(ClimaX):
def __init__(self, default_vars, img_size=..., patch_size=2, embed_dim=1024, depth=8, decoder_depth=2, num_heads=16, mlp_ratio=4, drop_path=0.1, drop_rate=0.1):
... | ClimaX/src/climax/regional_forecast/arch.py/0 | {
"file_path": "ClimaX/src/climax/regional_forecast/arch.py",
"repo_id": "ClimaX",
"token_count": 1754
} | 232 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.