text stringlengths 5 22M | id stringlengths 12 177 | metadata dict | __index_level_0__ int64 0 1.37k |
|---|---|---|---|
# Gitea Shared Service
As outbound access to public git repositories such as GitHub is often blocked a git mirror may be required. Gitea can be deployed as a shared service to offer this functionality.
Documentation on Gitea can be found here: [https://docs.gitea.io/](https://docs.gitea.io/).
## Deploy
To deploy th... | AzureTRE/docs/tre-templates/shared-services/gitea.md/0 | {
"file_path": "AzureTRE/docs/tre-templates/shared-services/gitea.md",
"repo_id": "AzureTRE",
"token_count": 807
} | 111 |
# MySQL Workspace Service
See: [MySQL Azure](https://learn.microsoft.com/en-GB/azure/mysql/)
## Prerequisites
- [A base workspace deployed](../workspaces/base.md)
- The MySQL workspace service container image needs building and pushing:
`make workspace_service_bundle BUNDLE=mysql`
## Authenticating to MySQL
1.... | AzureTRE/docs/tre-templates/workspace-services/mysql.md/0 | {
"file_path": "AzureTRE/docs/tre-templates/workspace-services/mysql.md",
"repo_id": "AzureTRE",
"token_count": 242
} | 112 |
# Checking the Service Bus
If the message payload is accepted by the API, and a **workspace_id** is generated, you should be able to track the progress of the deployment using `GET /api/workspaces/{workspace_id}`
Initially the status is always reported as:
```json
{
"deployment": {
"status": "awaiting_deployme... | AzureTRE/docs/troubleshooting-faq/troubleshooting-sb.md/0 | {
"file_path": "AzureTRE/docs/troubleshooting-faq/troubleshooting-sb.md",
"repo_id": "AzureTRE",
"token_count": 223
} | 113 |
import random
import pytest
import asyncio
from typing import Tuple
import config
import logging
from resources.resource import post_resource, disable_and_delete_resource
from resources.workspace import get_workspace_auth_details
from resources import strings as resource_strings
from helpers import get_admin_token
L... | AzureTRE/e2e_tests/conftest.py/0 | {
"file_path": "AzureTRE/e2e_tests/conftest.py",
"repo_id": "AzureTRE",
"token_count": 3152
} | 114 |
import pytest
from httpx import AsyncClient
import config
pytestmark = pytest.mark.asyncio
@pytest.mark.smoke
async def test_ui() -> None:
endpoint = f"{config.TRE_URL}"
async with AsyncClient(verify=False) as client:
response = await client.get(endpoint)
assert response.status_code == 200... | AzureTRE/e2e_tests/test_ui.py/0 | {
"file_path": "AzureTRE/e2e_tests/test_ui.py",
"repo_id": "AzureTRE",
"token_count": 141
} | 115 |
#!/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
# Generate required configuration for Porter Azure plugin
# TODO: Remove porter v0 https://github.com/microsoft/AzureTRE/issues/2990
# Documentation her... | AzureTRE/resource_processor/run.sh/0 | {
"file_path": "AzureTRE/resource_processor/run.sh",
"repo_id": "AzureTRE",
"token_count": 770
} | 116 |
{
"schemaType": "CredentialSet",
"schemaVersion": "1.0.1",
"namespace": "",
"name": "arm_auth",
"credentials": [
{
"name": "azure_client_id",
"source": {
"env": "ARM_CLIENT_ID"
}
},
{
"name": "azure_client_secret",
"source": {
"env": "ARM_CLIENT_SECRET... | AzureTRE/resource_processor/vmss_porter/arm_auth_local_debugging.json/0 | {
"file_path": "AzureTRE/resource_processor/vmss_porter/arm_auth_local_debugging.json",
"repo_id": "AzureTRE",
"token_count": 317
} | 117 |
variable "tre_id" {
type = string
description = "Unique TRE ID"
}
variable "tre_resource_id" {
type = string
description = "Resource ID"
}
variable "admin_jumpbox_vm_sku" {
type = string
}
| AzureTRE/templates/shared_services/admin-vm/terraform/variables.tf/0 | {
"file_path": "AzureTRE/templates/shared_services/admin-vm/terraform/variables.tf",
"repo_id": "AzureTRE",
"token_count": 86
} | 118 |
locals {
core_vnet = "vnet-${var.tre_id}"
core_resource_group_name = "rg-${var.tre_id}"
storage_account_name = lower(replace("stg-${var.tre_id}", "-", ""))
topic_name_suffix = "v2-${var.tre_... | AzureTRE/templates/shared_services/airlock_notifier/terraform/locals.tf/0 | {
"file_path": "AzureTRE/templates/shared_services/airlock_notifier/terraform/locals.tf",
"repo_id": "AzureTRE",
"token_count": 386
} | 119 |
data "azurerm_client_config" "current" {}
data "azurerm_resource_group" "rg" {
name = "rg-${var.tre_id}"
}
data "azurerm_key_vault" "key_vault" {
name = "kv-${var.tre_id}"
resource_group_name = data.azurerm_resource_group.rg.name
}
data "azurerm_subnet" "app_gw_subnet" {
name =... | AzureTRE/templates/shared_services/certs/terraform/data.tf/0 | {
"file_path": "AzureTRE/templates/shared_services/certs/terraform/data.tf",
"repo_id": "AzureTRE",
"token_count": 290
} | 120 |
output "databricks_workspace_name" {
value = azurerm_databricks_workspace.databricks.name
}
| AzureTRE/templates/shared_services/databricks-auth/terraform/outputs.tf/0 | {
"file_path": "AzureTRE/templates/shared_services/databricks-auth/terraform/outputs.tf",
"repo_id": "AzureTRE",
"token_count": 35
} | 121 |
resource "azurerm_route_table" "rt" {
name = "rt-${var.tre_id}"
resource_group_name = local.core_resource_group_name
location = data.azurerm_resource_group.rg.location
disable_bgp_route_propagation = false
tags = local.tre_shared... | AzureTRE/templates/shared_services/firewall/terraform/routetable.tf/0 | {
"file_path": "AzureTRE/templates/shared_services/firewall/terraform/routetable.tf",
"repo_id": "AzureTRE",
"token_count": 1344
} | 122 |
locals {
core_vnet = "vnet-${var.tre_id}"
core_resource_group_name = "rg-${var.tre_id}"
webapp_name = "gitea-${var.tre_id}"
storage_account_name = lower(replace("stg-${var.tre_id}", "-", ""))
keyvault_name = "kv-${var.tre_id}"
version = replace(rep... | AzureTRE/templates/shared_services/gitea/terraform/locals.tf/0 | {
"file_path": "AzureTRE/templates/shared_services/gitea/terraform/locals.tf",
"repo_id": "AzureTRE",
"token_count": 509
} | 123 |
data "azurerm_virtual_network" "core" {
name = local.core_vnet
resource_group_name = local.core_resource_group_name
}
data "azurerm_subnet" "shared" {
resource_group_name = local.core_resource_group_name
virtual_network_name = local.core_vnet
name = "SharedSubnet"
}
data "azu... | AzureTRE/templates/shared_services/sonatype-nexus-vm/terraform/data.tf/0 | {
"file_path": "AzureTRE/templates/shared_services/sonatype-nexus-vm/terraform/data.tf",
"repo_id": "AzureTRE",
"token_count": 515
} | 124 |
resource "random_password" "password" {
length = 16
lower = true
min_lower = 1
upper = true
min_upper = 1
numeric = true
min_numeric = 1
special = true
min_special = 1
override_special = "_%@"
}
resource "azurerm_key_vault_se... | AzureTRE/templates/workspace_services/azureml/terraform/compute.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/azureml/terraform/compute.tf",
"repo_id": "AzureTRE",
"token_count": 1245
} | 125 |
---
schemaVersion: 1.0.0
name: tre-user-resource-aml-compute-instance
version: 0.5.7
description: "Azure Machine Learning Compute Instance"
registry: azuretre
dockerfile: Dockerfile.tmpl
credentials:
- name: auth_tenant_id
env: AUTH_TENANT_ID
- name: azure_tenant_id
env: ARM_TENANT_ID
- name: azure_subsc... | AzureTRE/templates/workspace_services/azureml/user_resources/aml_compute/porter.yaml/0 | {
"file_path": "AzureTRE/templates/workspace_services/azureml/user_resources/aml_compute/porter.yaml",
"repo_id": "AzureTRE",
"token_count": 1581
} | 126 |
# This file is maintained automatically by "terraform init".
# Manual edits may be lost in future updates.
provider "registry.terraform.io/azure/azapi" {
version = "1.1.0"
constraints = "1.1.0"
hashes = [
"h1:IR+AHCwfjl1c0baWwfOwZ6QZtHj41H2syTgHkJtAr/M=",
"zh:2a25df6325a49f9e821f0b02c7da86167fc19a3ba... | AzureTRE/templates/workspace_services/databricks/terraform/.terraform.lock.hcl/0 | {
"file_path": "AzureTRE/templates/workspace_services/databricks/terraform/.terraform.lock.hcl",
"repo_id": "AzureTRE",
"token_count": 2611
} | 127 |
#!/bin/bash
set -e
function usage() {
cat <<USAGE
Usage: $0 [-t --tre-id]
Options:
-t, --tre-id ID of the TRE
-g, --github-repo URL to the github repo to clone e.g "https://github.com/Microsoft/AzureTRE"
USAGE
exit 1
}
# if no arguments are provided, return us... | AzureTRE/templates/workspace_services/gitea/gitea_migrate_repo.sh/0 | {
"file_path": "AzureTRE/templates/workspace_services/gitea/gitea_migrate_repo.sh",
"repo_id": "AzureTRE",
"token_count": 1195
} | 128 |
# Local .terraform directories
**/.terraform/*
# TF backend files
**/*_backend.tf
Dockerfile.tmpl
.env*
terraform/deploy.sh
terraform/destroy.sh
guacamole-server/
!guacamole-server/docker/version.txt
user_resources/
| AzureTRE/templates/workspace_services/guacamole/.dockerignore/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/.dockerignore",
"repo_id": "AzureTRE",
"token_count": 86
} | 129 |
# This is ssh server systemwide configuration file.
#
# /etc/sshd_config
Port 2222
ListenAddress 0.0.0.0
LoginGraceTime 180
X11Forwarding yes
Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr
MACs hmac-sha1,hmac-sha1-96
StrictModes yes
SyslogFacility DAEMON
PasswordAuthentication ye... | AzureTRE/templates/workspace_services/guacamole/guacamole-server/docker/sshd_config/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/guacamole-server/docker/sshd_config",
"repo_id": "AzureTRE",
"token_count": 173
} | 130 |
<?xml version="1.0" encoding="UTF-8"?>
<!--
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 the Apache... | AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/src/main/resources/logback.xml/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/src/main/resources/logback.xml",
"repo_id": "AzureTRE",
"token_count": 407
} | 131 |
data "azurerm_resource_group" "ws" {
name = "rg-${var.tre_id}-ws-${local.short_workspace_id}"
}
data "azurerm_virtual_network" "ws" {
name = "vnet-${var.tre_id}-ws-${local.short_workspace_id}"
resource_group_name = data.azurerm_resource_group.ws.name
}
data "azurerm_subnet" "services" {
name ... | AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-import-reviewvm/terraform/data.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-import-reviewvm/terraform/data.tf",
"repo_id": "AzureTRE",
"token_count": 379
} | 132 |
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/template_schema.json",
"type": "object",
"title": "Linux Virtual Machine",
"description": "Linux virtual machine.",
"required": [... | AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/template_schema.json/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/template_schema.json",
"repo_id": "AzureTRE",
"token_count": 532
} | 133 |
{
"schemaType": "ParameterSet",
"schemaVersion": "1.0.1",
"namespace": "",
"name": "tre-service-guacamole-windowsvm",
"parameters": [
{
"name": "workspace_id",
"source": {
"env": "WORKSPACE_ID"
}
},
{
"name": "parent_service_id",
"source": {
"env": "PA... | AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/parameters.json/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/parameters.json",
"repo_id": "AzureTRE",
"token_count": 939
} | 134 |
{
"schemaType": "ParameterSet",
"schemaVersion": "1.0.1",
"namespace": "",
"name": "tre-workspace-service-health",
"parameters": [
{
"name": "workspace_id",
"source": {
"env": "WORKSPACE_ID"
}
},
{
"name": "tre_id",
"source": {
"env": "TRE_ID"
}
... | AzureTRE/templates/workspace_services/health-services/parameters.json/0 | {
"file_path": "AzureTRE/templates/workspace_services/health-services/parameters.json",
"repo_id": "AzureTRE",
"token_count": 755
} | 135 |
{
"schemaType": "ParameterSet",
"schemaVersion": "1.0.1",
"namespace": "",
"name": "tre-service-innereye",
"parameters": [
{
"name": "id",
"source": {
"env": "ID"
}
},
{
"name": "workspace_id",
"source": {
"env": "WORKSPACE_ID"
}
},
{
... | AzureTRE/templates/workspace_services/innereye/parameters.json/0 | {
"file_path": "AzureTRE/templates/workspace_services/innereye/parameters.json",
"repo_id": "AzureTRE",
"token_count": 763
} | 136 |
{
"schemaVersion": "1.0.0-DRAFT+b6c701f",
"name": "azure",
"created": "2021-06-03T11:31:05.7314113Z",
"modified": "2021-06-03T11:31:05.7314113Z",
"credentials": [
{
"name": "azure_client_id",
"source": {
"env": "ARM_CLIENT_ID"
}
},
{
"name": "azure_client_secret",
... | AzureTRE/templates/workspace_services/mlflow/azure.json/0 | {
"file_path": "AzureTRE/templates/workspace_services/mlflow/azure.json",
"repo_id": "AzureTRE",
"token_count": 352
} | 137 |
output "mysql_fqdn" {
value = azurerm_mysql_flexible_server.mysql.fqdn
}
| AzureTRE/templates/workspace_services/mysql/terraform/outputs.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/mysql/terraform/outputs.tf",
"repo_id": "AzureTRE",
"token_count": 35
} | 138 |
/****** Copy Data ******/
CREATE TABLE #tbl
WITH
( DISTRIBUTION = ROUND_ROBIN
)
AS
SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS Sequence
, [name]
, 'DROP TABLE ' + N'$(RESULTS_SCHEMA_NAME)' + '.' + name AS sql_code
FROM sys.tables
WHERE schema_id = (select schema_id from sys.schemas where name = ... | AzureTRE/templates/workspace_services/ohdsi/sql/drop_synapse_schemas.sql/0 | {
"file_path": "AzureTRE/templates/workspace_services/ohdsi/sql/drop_synapse_schemas.sql",
"repo_id": "AzureTRE",
"token_count": 328
} | 139 |
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "https://github.com/microsoft/AzureTRE/templates/workspaces/base/template_schema.json",
"type": "object",
"title": "Base Workspace",
"description": "This workspace template is the foundation for TRE workspaces.",
"required": [
"auth_type",
... | AzureTRE/templates/workspaces/base/template_schema.json/0 | {
"file_path": "AzureTRE/templates/workspaces/base/template_schema.json",
"repo_id": "AzureTRE",
"token_count": 4738
} | 140 |
output "app_insights_connection_string" {
# value = azurerm_application_insights.workspace.connection_string
value = jsondecode(azapi_resource.appinsights.output).properties.ConnectionString
sensitive = true
}
output "log_analytics_workspace_id" {
value = azurerm_log_analytics_workspace.workspace.id
}
out... | AzureTRE/templates/workspaces/base/terraform/azure-monitor/outputs.tf/0 | {
"file_path": "AzureTRE/templates/workspaces/base/terraform/azure-monitor/outputs.tf",
"repo_id": "AzureTRE",
"token_count": 142
} | 141 |
output "workspace_resource_name_suffix" {
value = local.workspace_resource_name_suffix
}
# The following outputs are dependent on an Automatic AAD Workspace Application Registration.
# If we are not creating an App Reg we simple pass back the same values that were already created
# This is necessary so that we don't... | AzureTRE/templates/workspaces/base/terraform/outputs.tf/0 | {
"file_path": "AzureTRE/templates/workspaces/base/terraform/outputs.tf",
"repo_id": "AzureTRE",
"token_count": 403
} | 142 |
import { Dialog, PrimaryButton, DialogType, Stack, TooltipHost, TextField } from '@fluentui/react';
import React, { useState } from 'react';
import { Resource } from '../../models/resource';
interface ConfirmCopyUrlToClipboardProps {
resource: Resource,
onDismiss: () => void
}
// show a explanation about why conn... | AzureTRE/ui/app/src/components/shared/ConfirmCopyUrlToClipboard.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/shared/ConfirmCopyUrlToClipboard.tsx",
"repo_id": "AzureTRE",
"token_count": 781
} | 143 |
import { DefaultPalette, IStackItemStyles, Stack } from "@fluentui/react";
interface ResourceHistoryListItemProps {
header: String,
val: String
}
export const ResourceHistoryListItem: React.FunctionComponent<ResourceHistoryListItemProps> = (props: ResourceHistoryListItemProps) => {
const stackItemStyles:... | AzureTRE/ui/app/src/components/shared/ResourceHistoryListItem.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/shared/ResourceHistoryListItem.tsx",
"repo_id": "AzureTRE",
"token_count": 401
} | 144 |
import { Icon, mergeStyles, Panel, PanelType, PrimaryButton } from '@fluentui/react';
import React, { useEffect, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { ApiEndpoint } from '../../../models/apiEndpoints';
import { Operation } from '../../../models/operation';
import { ResourceTy... | AzureTRE/ui/app/src/components/shared/create-update-resource/CreateUpdateResource.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/shared/create-update-resource/CreateUpdateResource.tsx",
"repo_id": "AzureTRE",
"token_count": 2167
} | 145 |
import React, { useContext } from 'react';
import { Resource } from '../../models/resource';
import { WorkspaceService } from '../../models/workspaceService';
import { ResourceCardList } from '../shared/ResourceCardList';
import { PrimaryButton, Stack } from '@fluentui/react';
import { ResourceType } from '../../models... | AzureTRE/ui/app/src/components/workspaces/WorkspaceServices.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/workspaces/WorkspaceServices.tsx",
"repo_id": "AzureTRE",
"token_count": 962
} | 146 |
import { Operation } from "./operation";
import { ResourceType } from "./resourceType";
import { User } from "./user";
export interface Resource {
id: string,
isEnabled: boolean,
resourcePath: string,
resourceVersion: number,
resourceType: ResourceType
templateName: string,
templateVersion:... | AzureTRE/ui/app/src/models/resource.ts/0 | {
"file_path": "AzureTRE/ui/app/src/models/resource.ts",
"repo_id": "AzureTRE",
"token_count": 495
} | 147 |
FORMAT=$1
GOLD_FILE=$2
PREDICTION_FILE=$3
java -cp bc5cdr_eval.jar ncbi.bc5cdr_eval.Evaluate mention Disease $FORMAT $GOLD_FILE $PREDICTION_FILE | grep -v INFO
# java -cp bc5cdr_eval.jar ncbi.bc5cdr_eval.Evaluate mention Disease $FORMAT $GOLD_FILE $PREDICTION_FILE
| BioGPT/data/BC5CDR/raw/BC5CDR_Evaluation-0.0.3/eval_mention.sh/0 | {
"file_path": "BioGPT/data/BC5CDR/raw/BC5CDR_Evaluation-0.0.3/eval_mention.sh",
"repo_id": "BioGPT",
"token_count": 113
} | 148 |
# Question Answering on PubMedQA in Reasoning Required Setting
## Data
Download data from [PubMedQA](https://github.com/pubmedqa/pubmedqa) and following the steps of splitting dataset.
Copy the files `pqal_fold0/train_set.json`, `pqal_fold0/dev_set.json`, `test_set.json` and `test_ground_truth.json` to `../../data/Pu... | BioGPT/examples/QA-PubMedQA/README.md/0 | {
"file_path": "BioGPT/examples/QA-PubMedQA/README.md",
"repo_id": "BioGPT",
"token_count": 266
} | 149 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
MODEL_DIR=../../checkpoints/RE-DDI-BioGPT
MODEL=checkpoint_avg.pt
DATA_DIR=${PWD}/../../data/DDI/relis-bin
BASE_DATA_DIR=${DATA_DIR%/*}
BIN_DATA_DIR=${DATA_DIR##*/}
DATA_PREFIX=${BIN_DATA_DIR%-*}
RAW_DATA_DIR=${BASE_DATA_DIR}/raw
OUTPUT_FILE=gene... | BioGPT/examples/RE-DDI/infer.sh/0 | {
"file_path": "BioGPT/examples/RE-DDI/infer.sh",
"repo_id": "BioGPT",
"token_count": 562
} | 150 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#!/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 collections
import os
... | BioGPT/scripts/average_checkpoints.py/0 | {
"file_path": "BioGPT/scripts/average_checkpoints.py",
"repo_id": "BioGPT",
"token_count": 2590
} | 151 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import numpy as np
import tvm
from bitblas.base.roller.policy import TensorCorePolicy, DefaultPolicy
from bitblas.base.roller.arch import CUDA
from bitblas.gpu.matmul_analysis import get_tensorized_func_and_tags
from bitblas.gpu import Matmul
from... | BitBLAS/benchmark/dsl/convolution.py/0 | {
"file_path": "BitBLAS/benchmark/dsl/convolution.py",
"repo_id": "BitBLAS",
"token_count": 2592
} | 152 |
# coding=utf-8
# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.
#
# This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX
# and OPT implementations in this library. It has been modified from its
# original forms to accommodate minor architectural differences compared
# to G... | BitBLAS/integration/BitNet/tokenization_bitnet.py/0 | {
"file_path": "BitBLAS/integration/BitNet/tokenization_bitnet.py",
"repo_id": "BitBLAS",
"token_count": 9488
} | 153 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from logging import getLogger
import numpy as np
import torch
import torch.nn as nn
logger = getLogger(__name__)
try:
import bitblas # noqa: F401
except ImportError as e:
bitblas_import_exception = e
def error_raiser_bitblas(*arg... | BitBLAS/integration/pytorch/bitblas_quant_linear.py/0 | {
"file_path": "BitBLAS/integration/pytorch/bitblas_quant_linear.py",
"repo_id": "BitBLAS",
"token_count": 3627
} | 154 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from .node import PrimFuncNode # noqa: F401
from .hint import Hint # noqa: F401
from .policy import DefaultPolicy, TensorCorePolicy # noqa: F401
from .arch import TileDevice, CUDA # noqa: F401
| BitBLAS/python/bitblas/base/roller/__init__.py/0 | {
"file_path": "BitBLAS/python/bitblas/base/roller/__init__.py",
"repo_id": "BitBLAS",
"token_count": 84
} | 155 |
# 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/schedule_rule.py/0 | {
"file_path": "BitBLAS/python/bitblas/base/schedule_rule.py",
"repo_id": "BitBLAS",
"token_count": 2022
} | 156 |
# 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 enum import Enum
from typing import List, Optional, Set, Union, Tuple, Dict
from tvm import tir
from tvm.ir imp... | BitBLAS/python/bitblas/gpu/matmul_analysis.py/0 | {
"file_path": "BitBLAS/python/bitblas/gpu/matmul_analysis.py",
"repo_id": "BitBLAS",
"token_count": 12863
} | 157 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# pre-transformed tir expression of matmul
import tvm
from tvm import te
from bitblas.gpu.matmul_analysis import get_propagate_map
from bitblas.ops.operator import TransformKind
def matmul_nn(
M,
N,
K,
in_dtype="float16",
out... | BitBLAS/python/bitblas/ops/impl/matmul_impl.py/0 | {
"file_path": "BitBLAS/python/bitblas/ops/impl/matmul_impl.py",
"repo_id": "BitBLAS",
"token_count": 5449
} | 158 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from .post_process import match_global_kernel, tensor_replace_dp4a, tensor_remove_make_int4 # noqa: F401
from .tensor_adapter import tvm_tensor_to_torch, lazy_tvm_tensor_to_torch, lazy_torch_to_tvm_tensor # noqa: F401
from .target_detector impor... | BitBLAS/python/bitblas/utils/__init__.py/0 | {
"file_path": "BitBLAS/python/bitblas/utils/__init__.py",
"repo_id": "BitBLAS",
"token_count": 131
} | 159 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import pytest
import os
import torch
import bitblas
from bitblas.ops.matmul import Matmul, MatmulConfig
from bitblas.ops.matmul_dequantize import (
MatmulWeightOnlyDequantize,
MatmulWeightOnlyDequantizeConfig,
)
from bitblas.cache import g... | BitBLAS/testing/python/cache/test_operator_cache.py/0 | {
"file_path": "BitBLAS/testing/python/cache/test_operator_cache.py",
"repo_id": "BitBLAS",
"token_count": 6576
} | 160 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import tvm
from tvm.script import tir as T
from tvm.tir import IndexMap
from tvm.tir.tensor_intrin.cuda import (
ldmatrix_trans_32x8_to_shared_16x16_layout,
ldmatrix_32x16_to_shared_16x32_layout_a,
ldmatrix_32x16_to_shared_16x32_layout... | BitBLAS/testing/python/weight_only/index_map_fuse.py/0 | {
"file_path": "BitBLAS/testing/python/weight_only/index_map_fuse.py",
"repo_id": "BitBLAS",
"token_count": 1424
} | 161 |
date ; hostname ; pwd
EXP_NODES=1
EXP_IS=576
EXP_PGB=16
EXP_PGEB=64
EXP_LR=1e-5
EXP_BS=512
EXP_ME=10
EXP_WS=0.06
EXP_WD=0.05
EXP_LMH=50
EXP_LMC=5
EXP_THL=2
EXP_HHS=2
EXP_LP=BridgeTower_pt_base.ckpt
EXP_RGM=blip_randaug_wohf
export MASTER_ADDR=$HOSTNAME
export MASTER_PORT=19800
export NODE_RANK=0
PREFIX_NAME="ftfpt"
... | BridgeTower/scripts/ftfpt_base_vqa.sh/0 | {
"file_path": "BridgeTower/scripts/ftfpt_base_vqa.sh",
"repo_id": "BridgeTower",
"token_count": 604
} | 162 |
import torch
from pytorch_lightning import LightningDataModule
from torch.utils.data import DataLoader
from transformers import (
DataCollatorForLanguageModeling,
DataCollatorForWholeWordMask,
BertTokenizer,
RobertaTokenizer,
)
def get_pretrained_tokenizer(from_pretrained):
if torch.distributed.i... | BridgeTower/src/datamodules/datamodule_base.py/0 | {
"file_path": "BridgeTower/src/datamodules/datamodule_base.py",
"repo_id": "BridgeTower",
"token_count": 2974
} | 163 |
from .base_dataset import BaseDataset
import io
from PIL import Image
class VisualGenomeCaptionDataset(BaseDataset):
def __init__(self, *args, split="", **kwargs):
assert split in ["train", "val", "test"]
if split == "test":
split = "val"
if split == "train":
names... | BridgeTower/src/datasets/vg_caption_dataset.py/0 | {
"file_path": "BridgeTower/src/datasets/vg_caption_dataset.py",
"repo_id": "BridgeTower",
"token_count": 237
} | 164 |
from .transform import (
pixelbert_transform,
pixelbert_transform_randaug,
vit_transform,
vit_transform_randaug,
imagenet_transform,
imagenet_transform_randaug,
clip_transform,
clip_transform_randaug,
blip_transform,
blip_transform_randaug,
blip_transform_randaug_wc,
blip... | BridgeTower/src/transforms/__init__.py/0 | {
"file_path": "BridgeTower/src/transforms/__init__.py",
"repo_id": "BridgeTower",
"token_count": 440
} | 165 |
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 get_score(occurences):
if occurences == 0:
return 0.0
elif occurences == 1:
return 0.3
... | BridgeTower/src/utils/write_vqa.py/0 | {
"file_path": "BridgeTower/src/utils/write_vqa.py",
"repo_id": "BridgeTower",
"token_count": 3840
} | 166 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import torch
import numpy as np
import skimage.io as io
# from FaceSDK.face_sdk import FaceDetection
# from face_sdk import FaceDetection
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
from skimage.transform import Simi... | Bringing-Old-Photos-Back-to-Life/Face_Detection/detect_all_dlib.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/Face_Detection/detect_all_dlib.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 2438
} | 167 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
def CreateDataLoader(opt):
from data.custom_dataset_data_loader import CustomDatasetDataLoader
data_loader = CustomDatasetDataLoader()
print(data_loader.name())
data_loader.initialize(opt)
return data_loader
| Bringing-Old-Photos-Back-to-Life/Global/data/data_loader.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/Global/data/data_loader.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 97
} | 168 |
build:
gpu: true
python_version: "3.8"
system_packages:
- "libgl1-mesa-glx"
- "libglib2.0-0"
python_packages:
- "cmake==3.21.2"
- "torchvision==0.9.0"
- "torch==1.8.0"
- "numpy==1.19.4"
- "opencv-python==4.4.0.46"
- "scipy==1.5.3"
- "tensorboardX==2.4"
- "dominate==2.6.0"... | Bringing-Old-Photos-Back-to-Life/cog.yaml/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/cog.yaml",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 326
} | 169 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import argparse
import shutil
import sys
from subprocess import call
def run_cmd(command):
try:
call(command, shell=True)
except KeyboardInterrupt:
print("Process interrupted")
sys.exit(1)
if __name__ =... | Bringing-Old-Photos-Back-to-Life/run.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/run.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 3260
} | 170 |
from torch.utils.data import Dataset
from torchvision.datasets.utils import download_url
from tqdm import tqdm
import pandas as pd
import os
import torch.nn as nn
import torch
class AudioDataset(Dataset):
def __init__(self, root: str, download: bool = True):
self.root = os.path.expanduser(root)
if ... | CLAP/examples/esc50_dataset.py/0 | {
"file_path": "CLAP/examples/esc50_dataset.py",
"repo_id": "CLAP",
"token_count": 1217
} | 171 |
@ECHO OFF
pushd %~dp0
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=python -msphinx
)
set SOURCEDIR=.
set BUILDDIR=_build
set SPHINXPROJ=fairseq
if "%1" == "" goto help
%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The Sphinx module was not found. Make sure you ... | COCO-LM/fairseq/docs/make.bat/0 | {
"file_path": "COCO-LM/fairseq/docs/make.bat",
"repo_id": "COCO-LM",
"token_count": 316
} | 172 |
# 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.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq.modules.layer_norm import Lay... | COCO-LM/fairseq/examples/adaptive_span/adaptive_span_model.py/0 | {
"file_path": "COCO-LM/fairseq/examples/adaptive_span/adaptive_span_model.py",
"repo_id": "COCO-LM",
"token_count": 4392
} | 173 |
# 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.
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the r... | COCO-LM/fairseq/examples/byte_level_bpe/gru_transformer.py/0 | {
"file_path": "COCO-LM/fairseq/examples/byte_level_bpe/gru_transformer.py",
"repo_id": "COCO-LM",
"token_count": 1992
} | 174 |
# Language Models not just for Pre-training: Fast Online Neural Noisy Channel Modeling
## Introduction
- [Yee et al. (2019)](https://www.aclweb.org/anthology/D19-1571.pdf) introduce a simple and effective noisy channel modeling approach for neural machine translation. However, the noisy channel online decoding approac... | COCO-LM/fairseq/examples/fast_noisy_channel/README.md/0 | {
"file_path": "COCO-LM/fairseq/examples/fast_noisy_channel/README.md",
"repo_id": "COCO-LM",
"token_count": 7677
} | 175 |
# 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, defaultdict
import json
import os
import logging
from fairseq import options, models
from fairseq.data ... | COCO-LM/fairseq/examples/laser/laser_src/laser_task.py/0 | {
"file_path": "COCO-LM/fairseq/examples/laser/laser_src/laser_task.py",
"repo_id": "COCO-LM",
"token_count": 5535
} | 176 |
#!/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.
# Use: echo {text} | python tokenize_indic.py {language}
import sys
from indicnlp.normalize.indic_normalize import In... | COCO-LM/fairseq/examples/m2m_100/tokenizers/tokenize_indic.py/0 | {
"file_path": "COCO-LM/fairseq/examples/m2m_100/tokenizers/tokenize_indic.py",
"repo_id": "COCO-LM",
"token_count": 244
} | 177 |
#!/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.
# set -x -e
if [ -z $WORKDIR_ROOT ] ;
then
echo "please specify your working directory root in environ... | COCO-LM/fairseq/examples/multilingual/data_scripts/download_af_xh.sh/0 | {
"file_path": "COCO-LM/fairseq/examples/multilingual/data_scripts/download_af_xh.sh",
"repo_id": "COCO-LM",
"token_count": 2235
} | 178 |
#!/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.
lang_pairs="en-fr,en-cs,fr-en,cs-en"
path_2_data=$1 # <path to data>
lang_list=$2 # <path to a file which conta... | COCO-LM/fairseq/examples/multilingual/multilingual_fairseq_gen.sh/0 | {
"file_path": "COCO-LM/fairseq/examples/multilingual/multilingual_fairseq_gen.sh",
"repo_id": "COCO-LM",
"token_count": 284
} | 179 |
# Transformer with Pointer-Generator Network
This page describes the `transformer_pointer_generator` model that incorporates
a pointing mechanism in the Transformer model that facilitates copying of input
words to the output. This architecture is described in [Enarvi et al. (2020)](https://www.aclweb.org/anthology/202... | COCO-LM/fairseq/examples/pointer_generator/README.md/0 | {
"file_path": "COCO-LM/fairseq/examples/pointer_generator/README.md",
"repo_id": "COCO-LM",
"token_count": 1054
} | 180 |
# Simultaneous Machine Translation
This directory contains the code for the paper [Monotonic Multihead Attention](https://openreview.net/forum?id=Hyg96gBKPS)
## Prepare Data
[Please follow the instructions to download and preprocess the WMT'15 En-De dataset.](https://github.com/pytorch/fairseq/tree/simulastsharedtas... | COCO-LM/fairseq/examples/simultaneous_translation/README.md/0 | {
"file_path": "COCO-LM/fairseq/examples/simultaneous_translation/README.md",
"repo_id": "COCO-LM",
"token_count": 1310
} | 181 |
# 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.
from fairseq import checkpoint_uti... | COCO-LM/fairseq/examples/simultaneous_translation/models/convtransformer_simul_trans.py/0 | {
"file_path": "COCO-LM/fairseq/examples/simultaneous_translation/models/convtransformer_simul_trans.py",
"repo_id": "COCO-LM",
"token_count": 1935
} | 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 os
import numpy as np
from fairseq.data import FairseqDataset
from . import data_utils
from .collaters import Seq2SeqCollater
class... | COCO-LM/fairseq/examples/speech_recognition/data/asr_dataset.py/0 | {
"file_path": "COCO-LM/fairseq/examples/speech_recognition/data/asr_dataset.py",
"repo_id": "COCO-LM",
"token_count": 1776
} | 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.
import json
import os
import re
import sys
import torch
from examples.speech_recognition.data import AsrDataset
from examples.speech_recognit... | COCO-LM/fairseq/examples/speech_recognition/tasks/speech_recognition.py/0 | {
"file_path": "COCO-LM/fairseq/examples/speech_recognition/tasks/speech_recognition.py",
"repo_id": "COCO-LM",
"token_count": 2518
} | 184 |
# Hierarchical Neural Story Generation (Fan et al., 2018)
The following commands provide an example of pre-processing data, training a model, and generating text for story generation with the WritingPrompts dataset.
## Pre-trained models
Description | Dataset | Model | Test set(s)
---|---|---|---
Stories with Convol... | COCO-LM/fairseq/examples/stories/README.md/0 | {
"file_path": "COCO-LM/fairseq/examples/stories/README.md",
"repo_id": "COCO-LM",
"token_count": 1306
} | 185 |
# Unsupervised Quality Estimation for Neural Machine Translation (Fomicheva et al., 2020)
This page includes instructions for reproducing results from the paper [Unsupervised Quality Estimation for Neural
Machine Translation (Fomicheva et al., 2020)](https://arxiv.org/abs/2005.10608)
## Requirements:
* mosesdecoder:... | COCO-LM/fairseq/examples/unsupervised_quality_estimation/README.md/0 | {
"file_path": "COCO-LM/fairseq/examples/unsupervised_quality_estimation/README.md",
"repo_id": "COCO-LM",
"token_count": 1846
} | 186 |
# @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: 320000
min_sample_size: 32000
normalize: true
dataset:
num_workers: ... | COCO-LM/fairseq/examples/wav2vec/config/pretraining/wav2vec2_large_librivox.yaml/0 | {
"file_path": "COCO-LM/fairseq/examples/wav2vec/config/pretraining/wav2vec2_large_librivox.yaml",
"repo_id": "COCO-LM",
"token_count": 520
} | 187 |
# 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 os
from collections import Counter
import torch
from fairseq.file_io import PathManager
from fairseq.tokenizer import tokenize_line
fr... | COCO-LM/fairseq/fairseq/binarizer.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/binarizer.py",
"repo_id": "COCO-LM",
"token_count": 2037
} | 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 math
from fairseq import metrics, utils
from fairseq.criterions import register_criterion
from .label_smoothed_cross_entropy import L... | COCO-LM/fairseq/fairseq/criterions/label_smoothed_cross_entropy_with_alignment.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/criterions/label_smoothed_cross_entropy_with_alignment.py",
"repo_id": "COCO-LM",
"token_count": 2042
} | 189 |
import math
import numbers
from typing import Optional
import numpy as np
from fairseq.data.audio.feature_transforms import (
AudioFeatureTransform,
register_audio_feature_transform,
)
@register_audio_feature_transform("specaugment")
class SpecAugmentTransform(AudioFeatureTransform):
"""SpecAugment (http... | COCO-LM/fairseq/fairseq/data/audio/feature_transforms/specaugment.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/audio/feature_transforms/specaugment.py",
"repo_id": "COCO-LM",
"token_count": 2426
} | 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.
from dataclasses import dataclass, field
from fairseq import file_utils
from fairseq.data.encoders import register_bpe
from fairseq.data.enc... | COCO-LM/fairseq/fairseq/data/encoders/byte_bpe.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/encoders/byte_bpe.py",
"repo_id": "COCO-LM",
"token_count": 566
} | 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 os
import subprocess
import threading
from pathlib import Path
import numpy as np
import torch
def fasta_file_path(prefix_path):
... | COCO-LM/fairseq/fairseq/data/fasta_dataset.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/fasta_dataset.py",
"repo_id": "COCO-LM",
"token_count": 1549
} | 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.
from . import BaseWrapperDataset
class ReplaceDataset(BaseWrapperDataset):
"""Replaces tokens found in the dataset by a specified replac... | COCO-LM/fairseq/fairseq/data/replace_dataset.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/replace_dataset.py",
"repo_id": "COCO-LM",
"token_count": 520
} | 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 torch
from . import FairseqDataset
class TransformEosDataset(FairseqDataset):
"""A :class:`~fairseq.data.FairseqDataset` wrapper... | COCO-LM/fairseq/fairseq/data/transform_eos_dataset.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/data/transform_eos_dataset.py",
"repo_id": "COCO-LM",
"token_count": 2131
} | 194 |
#!/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 argparse
import copy
import logging
import os
from typing import Any, Dict, Iterator, List
import torch
from... | COCO-LM/fairseq/fairseq/hub_utils.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/hub_utils.py",
"repo_id": "COCO-LM",
"token_count": 5160
} | 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.
"""
RoBERTa: A Robustly Optimized BERT Pretraining Approach.
"""
import logging
import torch
import torch.nn as nn
import torch.nn.functional... | COCO-LM/fairseq/fairseq/model_parallel/models/roberta/model.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/model_parallel/models/roberta/model.py",
"repo_id": "COCO-LM",
"token_count": 3336
} | 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 logging
from typing import Dict, Optional
from fairseq.incremental_decoding_utils import with_incremental_state
from fairseq.models im... | COCO-LM/fairseq/fairseq/models/fairseq_incremental_decoder.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/models/fairseq_incremental_decoder.py",
"repo_id": "COCO-LM",
"token_count": 1752
} | 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 math
import torch
from fairseq.models.transformer import (
TransformerDecoder,
TransformerEncoder,
TransformerModel,
)
fro... | COCO-LM/fairseq/fairseq/models/nat/fairseq_nat_model.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/models/nat/fairseq_nat_model.py",
"repo_id": "COCO-LM",
"token_count": 2566
} | 198 |
#!/usr/bin/env python3
from ast import literal_eval
from typing import List, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from fairseq import checkpoint_utils, utils
from fairseq.data.data_utils import lengths_to_padding_mask
from fairseq.models import (
FairseqEncoder,
FairseqEnco... | COCO-LM/fairseq/fairseq/models/speech_to_text/berard.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/models/speech_to_text/berard.py",
"repo_id": "COCO-LM",
"token_count": 11158
} | 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.
"""isort:skip_file"""
from .adaptive_input import AdaptiveInput
from .adaptive_softmax import AdaptiveSoftmax
from .beamable_mm import Beamabl... | COCO-LM/fairseq/fairseq/modules/__init__.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/modules/__init__.py",
"repo_id": "COCO-LM",
"token_count": 922
} | 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.
*/
#include "dynamicconv_cuda.cuh"
#include "dynamicconv_cuda_forward.cu"
#include "dynamicconv_cuda_backward.cu"
#include "../cuda_... | COCO-LM/fairseq/fairseq/modules/dynamicconv_layer/dynamicconv_cuda_kernel.cu/0 | {
"file_path": "COCO-LM/fairseq/fairseq/modules/dynamicconv_layer/dynamicconv_cuda_kernel.cu",
"repo_id": "COCO-LM",
"token_count": 2588
} | 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.
*/
#include <ATen/ATen.h>
#include <c10/cuda/CUDAStream.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <algorithm>
#inclu... | COCO-LM/fairseq/fairseq/modules/lightconv_layer/lightconv_cuda.cuh/0 | {
"file_path": "COCO-LM/fairseq/fairseq/modules/lightconv_layer/lightconv_cuda.cuh",
"repo_id": "COCO-LM",
"token_count": 881
} | 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.
from .em import EM, EmptyClusterResolveError
class PQ(EM):
"""
Quantizes the layer weights W with the standard Product Quantization
... | COCO-LM/fairseq/fairseq/modules/quantization/pq/pq.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/modules/quantization/pq/pq.py",
"repo_id": "COCO-LM",
"token_count": 2080
} | 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 fairseq.modules import TransformerSentenceEncoderLayer
from fairseq.modules.sparse_multihead_attention import SparseMultiheadAttention
... | COCO-LM/fairseq/fairseq/modules/sparse_transformer_sentence_encoder_layer.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/modules/sparse_transformer_sentence_encoder_layer.py",
"repo_id": "COCO-LM",
"token_count": 723
} | 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 logging
from collections import defaultdict
from dataclasses import dataclass, field
from typing import Dict, Any, List, Optional
impo... | COCO-LM/fairseq/fairseq/optim/composite.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/optim/composite.py",
"repo_id": "COCO-LM",
"token_count": 2905
} | 205 |
# 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, field
from typing import Optional, List, Tuple
from omegaconf import II
from fairseq.dataclass... | COCO-LM/fairseq/fairseq/optim/lr_scheduler/tri_stage_lr_scheduler.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/optim/lr_scheduler/tri_stage_lr_scheduler.py",
"repo_id": "COCO-LM",
"token_count": 2535
} | 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.
import sys
import torch
from fairseq import utils
class SequenceScorer(object):
"""Scores the target for a given source sentence."""
... | COCO-LM/fairseq/fairseq/sequence_scorer.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/sequence_scorer.py",
"repo_id": "COCO-LM",
"token_count": 3158
} | 207 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
import pickle
import torch
import numpy as np
from fairseq.data import (
data_utils,
Dictionary,
encoders,
BaseWrapperDataset,
IdDataset,
NumSamplesDataset,
NumelDataset,
NestedDictionaryDataset,
So... | COCO-LM/fairseq/fairseq/tasks/squad.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq/tasks/squad.py",
"repo_id": "COCO-LM",
"token_count": 2161
} | 208 |
#!/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.
"""
Translate raw text with a trained model. Batches data on-the-fly.
"""
import ast
import fileinput
import logging... | COCO-LM/fairseq/fairseq_cli/interactive.py/0 | {
"file_path": "COCO-LM/fairseq/fairseq_cli/interactive.py",
"repo_id": "COCO-LM",
"token_count": 5590
} | 209 |
# May help avoid undefined symbol errors https://pytorch.org/cppdocs/notes/faq.html#undefined-symbol-errors-from-pytorch-aten
import torch
import warnings
from . import * | COCO-LM/fairseq/fused_ops/fused_ops/__init__.py/0 | {
"file_path": "COCO-LM/fairseq/fused_ops/fused_ops/__init__.py",
"repo_id": "COCO-LM",
"token_count": 52
} | 210 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.