text
stringlengths
5
22M
id
stringlengths
12
177
metadata
dict
__index_level_0__
int64
0
1.37k
{ "modelname": "TemplatePT", "uppercase_modelname": "TEMPLATE_PT", "lowercase_modelname": "template_pt", "camelcase_modelname": "TemplatePt", "authors": "The HuggingFace Team", "checkpoint_identifier": "brand-new-bert-base-cased", "tokenizer_type": "Based on BERT", "generate_tensorflow_and_pytorch": "Py...
AdaMix/templates/adding_a_new_model/tests/pt-encoder-bert-tokenizer.json/0
{ "file_path": "AdaMix/templates/adding_a_new_model/tests/pt-encoder-bert-tokenizer.json", "repo_id": "AdaMix", "token_count": 145 }
67
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
AdaMix/tests/test_benchmark.py/0
{ "file_path": "AdaMix/tests/test_benchmark.py", "repo_id": "AdaMix", "token_count": 4950 }
68
# coding=utf-8 # Copyright 2019-present, the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
AdaMix/tests/test_hf_api.py/0
{ "file_path": "AdaMix/tests/test_hf_api.py", "repo_id": "AdaMix", "token_count": 3012 }
69
# coding=utf-8 # Copyright 2018 Salesforce and HuggingFace Inc. team. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
AdaMix/tests/test_modeling_ctrl.py/0
{ "file_path": "AdaMix/tests/test_modeling_ctrl.py", "repo_id": "AdaMix", "token_count": 3832 }
70
# coding=utf-8 # Copyright 2020 The SqueezeBert authors and The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
AdaMix/tests/test_modeling_squeezebert.py/0
{ "file_path": "AdaMix/tests/test_modeling_squeezebert.py", "repo_id": "AdaMix", "token_count": 5715 }
71
# coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
AdaMix/tests/test_modeling_tf_electra.py/0
{ "file_path": "AdaMix/tests/test_modeling_tf_electra.py", "repo_id": "AdaMix", "token_count": 4804 }
72
# coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
AdaMix/tests/test_modeling_tf_roberta.py/0
{ "file_path": "AdaMix/tests/test_modeling_tf_roberta.py", "repo_id": "AdaMix", "token_count": 4791 }
73
# Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
AdaMix/tests/test_pipelines_common.py/0
{ "file_path": "AdaMix/tests/test_pipelines_common.py", "repo_id": "AdaMix", "token_count": 4465 }
74
# coding=utf-8 # Copyright 2021 HuggingFace Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
AdaMix/tests/test_sequence_feature_extraction_common.py/0
{ "file_path": "AdaMix/tests/test_sequence_feature_extraction_common.py", "repo_id": "AdaMix", "token_count": 4815 }
75
# coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
AdaMix/tests/test_tokenization_distilbert.py/0
{ "file_path": "AdaMix/tests/test_tokenization_distilbert.py", "repo_id": "AdaMix", "token_count": 572 }
76
# coding=utf-8 # Copyright 2020 The HuggingFace Inc. team, The Microsoft Research team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
AdaMix/tests/test_tokenization_prophetnet.py/0
{ "file_path": "AdaMix/tests/test_tokenization_prophetnet.py", "repo_id": "AdaMix", "token_count": 3447 }
77
# coding=utf-8 # Copyright 2018 the HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
AdaMix/tests/test_trainer.py/0
{ "file_path": "AdaMix/tests/test_trainer.py", "repo_id": "AdaMix", "token_count": 21678 }
78
# coding=utf-8 # Copyright 2020 The HuggingFace Inc. team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
AdaMix/utils/get_modified_files.py/0
{ "file_path": "AdaMix/utils/get_modified_files.py", "repo_id": "AdaMix", "token_count": 435 }
79
## AirSim Drone Racing Lab: Overview <img src="https://github.com/madratman/airsim_neurips_gifs/blob/master/imgs/race.gif?raw=true" width="400"> ADRL is a framework for drone racing research, built on [Microsoft AirSim](https://github.com/Microsoft/Airsim). We used our framework to host a simulation-based drone ra...
AirSim-Drone-Racing-Lab/docs/adrl_overview.md/0
{ "file_path": "AirSim-Drone-Racing-Lab/docs/adrl_overview.md", "repo_id": "AirSim-Drone-Racing-Lab", "token_count": 530 }
80
import time from PoseSampler import * num_samples = 100 dataset_path = '/home/rb/all_files/airsim_datasets/soccer_test' # check if output folder exists if not os.path.isdir(dataset_path): os.makedirs(dataset_path) img_dir = os.path.join(dataset_path, 'images') os.makedirs(img_dir) else: print('Error: ...
AirSim-Drone-Racing-VAE-Imitation/datagen/img_generator/main.py/0
{ "file_path": "AirSim-Drone-Racing-VAE-Imitation/datagen/img_generator/main.py", "repo_id": "AirSim-Drone-Racing-VAE-Imitation", "token_count": 245 }
81
from .dataset_utils import * from .stats_utils import * from .geom_utils import * from .trajectory_utils import *
AirSim-Drone-Racing-VAE-Imitation/racing_utils/__init__.py/0
{ "file_path": "AirSim-Drone-Racing-VAE-Imitation/racing_utils/__init__.py", "repo_id": "AirSim-Drone-Racing-VAE-Imitation", "token_count": 36 }
82
#!/bin/bash wget -c https://github.com/microsoft/AirSim-NeurIPS2019-Drone-Racing/releases/download/v1.1-linux/AirSim.zip; mkdir -p /home/$USER/Documents/AirSim; unzip AirSim.zip; mv AirSim AirSim_Final_Round; wget --directory-prefix=AirSim_Final_Round/AirSimExe/Content/Paks -c https://github.com/microsoft/AirSim-NeurIP...
AirSim-NeurIPS2019-Drone-Racing/download_final_round_binaries.sh/0
{ "file_path": "AirSim-NeurIPS2019-Drone-Racing/download_final_round_binaries.sh", "repo_id": "AirSim-NeurIPS2019-Drone-Racing", "token_count": 289 }
83
include *.md include azure/__init__.py include azure/monitor/__init__.py include LICENSE recursive-include tests *.py recursive-include samples *.py *.md global-exclude *.pyc global-exclude *.pyo global-exclude __pycache__/*
ApplicationInsights-Python/azure-monitor-events-extension/MANIFEST.in/0
{ "file_path": "ApplicationInsights-Python/azure-monitor-events-extension/MANIFEST.in", "repo_id": "ApplicationInsights-Python", "token_count": 74 }
84
--- repos: - repo: https://github.com/pycqa/flake8 rev: '6.0.0' hooks: - id: flake8 - repo: https://github.com/hcodes/yaspeller rev: v8.0.1 hooks: - id: yaspeller
AzureTRE/.pre-commit-config.yaml/0
{ "file_path": "AzureTRE/.pre-commit-config.yaml", "repo_id": "AzureTRE", "token_count": 103 }
85
import logging import json import azure.functions as func from azure.storage.blob import BlobServiceClient from shared_code import blob_operations def delete_blob_and_container_if_last_blob(blob_url: str): storage_account_name, container_name, blob_name = blob_operations.get_blob_info_from_blob_url(blob_url=blo...
AzureTRE/airlock_processor/DataDeletionTrigger/__init__.py/0
{ "file_path": "AzureTRE/airlock_processor/DataDeletionTrigger/__init__.py", "repo_id": "AzureTRE", "token_count": 651 }
86
from resources import strings from fastapi import Request from fastapi.responses import PlainTextResponse from services.logging import logger async def generic_error_handler(_: Request, exception: Exception) -> PlainTextResponse: logger.debug("=====================================") logger.exception(excepti...
AzureTRE/api_app/api/errors/generic_error.py/0
{ "file_path": "AzureTRE/api_app/api/errors/generic_error.py", "repo_id": "AzureTRE", "token_count": 121 }
87
from typing import Optional from fastapi import APIRouter, Depends, HTTPException, status from pydantic import parse_obj_as from api.dependencies.workspace_service_templates import get_workspace_service_template_by_name_from_path from api.routes.resource_helpers import get_template from db.errors import EntityVersion...
AzureTRE/api_app/api/routes/user_resource_templates.py/0
{ "file_path": "AzureTRE/api_app/api/routes/user_resource_templates.py", "repo_id": "AzureTRE", "token_count": 1036 }
88
from typing import Optional from azure.cosmos.aio import ContainerProxy from azure.core import MatchConditions from pydantic import BaseModel from api.dependencies.database import Database from db.errors import UnableToAccessDatabase class BaseRepository: @classmethod async def create(cls, container_name: Op...
AzureTRE/api_app/db/repositories/base.py/0
{ "file_path": "AzureTRE/api_app/db/repositories/base.py", "repo_id": "AzureTRE", "token_count": 841 }
89
from pydantic import Field from pydantic.types import UUID4 from pydantic.schema import Optional from models.domain.azuretremodel import AzureTREModel from typing import List from models.domain.airlock_request import AirlockFile class EventGridMessageData(AzureTREModel): completed_step: str = Field(title="", desc...
AzureTRE/api_app/models/domain/airlock_operations.py/0
{ "file_path": "AzureTRE/api_app/models/domain/airlock_operations.py", "repo_id": "AzureTRE", "token_count": 328 }
90
from typing import List from pydantic import BaseModel, Field from models.domain.resource import ResourceType from models.domain.workspace_service import WorkspaceService def get_sample_workspace_service(workspace_id: str, workspace_service_id: str) -> dict: return { "id": workspace_service_id, ...
AzureTRE/api_app/models/schemas/workspace_service.py/0
{ "file_path": "AzureTRE/api_app/models/schemas/workspace_service.py", "repo_id": "AzureTRE", "token_count": 945 }
91
import asyncio import json from azure.servicebus.aio import ServiceBusClient, AutoLockRenewer from azure.servicebus.exceptions import OperationTimeoutError, ServiceBusConnectionError from fastapi import HTTPException from pydantic import ValidationError, parse_obj_as from api.dependencies.airlock import get_airlock_r...
AzureTRE/api_app/service_bus/airlock_request_status_update.py/0
{ "file_path": "AzureTRE/api_app/service_bus/airlock_request_status_update.py", "repo_id": "AzureTRE", "token_count": 2901 }
92
import json import pytest from mock import patch from pydantic import parse_obj_as from starlette import status from db.errors import EntityDoesNotExist, EntityVersionExist, InvalidInput, UnableToAccessDatabase from services.authentication import get_current_admin_user, get_current_tre_user_or_tre_admin from models.d...
AzureTRE/api_app/tests_ma/test_api/test_routes/test_shared_service_templates.py/0
{ "file_path": "AzureTRE/api_app/tests_ma/test_api/test_routes/test_shared_service_templates.py", "repo_id": "AzureTRE", "token_count": 2297 }
93
import copy from unittest.mock import AsyncMock import uuid import pytest import pytest_asyncio from mock import patch, MagicMock from jsonschema.exceptions import ValidationError from db.repositories.resources_history import ResourceHistoryRepository from tests_ma.test_api.test_routes.test_resource_helpers import FAK...
AzureTRE/api_app/tests_ma/test_db/test_repositories/test_resource_repository.py/0
{ "file_path": "AzureTRE/api_app/tests_ma/test_db/test_repositories/test_resource_repository.py", "repo_id": "AzureTRE", "token_count": 8908 }
94
import pytest from mock import call, patch from models.domain.authentication import User, RoleAssignment from models.domain.workspace import Workspace, WorkspaceRole from services.aad_authentication import AzureADAuthorization from services.access_service import AuthConfigValidationError MOCK_MICROSOFT_GRAPH_URL = "h...
AzureTRE/api_app/tests_ma/test_services/test_aad_access_service.py/0
{ "file_path": "AzureTRE/api_app/tests_ma/test_services/test_aad_access_service.py", "repo_id": "AzureTRE", "token_count": 10999 }
95
from logging import Logger import sys from time import sleep import click from tre.api_client import ApiClient from tre.output import output def get_operation_id_completion(ctx: click.Context, log: Logger, list_url: str, param: click.Parameter, incomplete: str, scope_id: str = None): client = ApiClient.get_api_c...
AzureTRE/cli/tre/commands/operation.py/0
{ "file_path": "AzureTRE/cli/tre/commands/operation.py", "repo_id": "AzureTRE", "token_count": 1387 }
96
import json import logging import click from tre.api_client import ApiClient from tre.output import output, output_option, query_option from tre.commands.workspace_service_templates.contexts import pass_workspace_service_template_context, WorkspaceServiceTemplateContext @click.group(name="user-resource-templates", ...
AzureTRE/cli/tre/commands/workspace_service_templates/user_resource_templates/user_resource_templates.py/0
{ "file_path": "AzureTRE/cli/tre/commands/workspace_service_templates/user_resource_templates/user_resource_templates.py", "repo_id": "AzureTRE", "token_count": 894 }
97
{ "$schema": "http://json-schema.org/draft-04/schema#", "$id": "https://github.com/microsoft/AzureTRE/schema/config_schema.json", "title": "AzureTRE configuration file", "description": "This document contains all the configuration needed to deploy and setup AzureTRE.", "type": "object", "properties": { ...
AzureTRE/config_schema.json/0
{ "file_path": "AzureTRE/config_schema.json", "repo_id": "AzureTRE", "token_count": 2949 }
98
locals { staticweb_storage_name = lower(replace("stweb${var.tre_id}", "-", "")) staticweb_backend_pool_name = "beap-staticweb" api_backend_pool_name = "beap-api" app_path_map_name = "upm-application" redirect_path_map_name = "upm-redirect" insecure_frontend_port_name = "feport-insecur...
AzureTRE/core/terraform/appgateway/locals.tf/0
{ "file_path": "AzureTRE/core/terraform/appgateway/locals.tf", "repo_id": "AzureTRE", "token_count": 449 }
99
#!/bin/bash set -o errexit set -o pipefail set -o nounset # set -o xtrace # These variables are loaded in for us # shellcheck disable=SC2154 ../../devops/scripts/terraform_wrapper.sh -g "${TF_VAR_mgmt_resource_group_name}" \ -s "${TF_VAR_mgmt_storage_account_name}" \ ...
AzureTRE/core/terraform/destroy.sh/0
{ "file_path": "AzureTRE/core/terraform/destroy.sh", "repo_id": "AzureTRE", "token_count": 274 }
100
#!/bin/bash set -e if [ ! -f ../tre_output.json ]; then # Connect to the remote backend of Terraform export TF_LOG="" # shellcheck disable=SC2154 terraform init -input=false -backend=true -reconfigure \ -backend-config="resource_group_name=$TF_VAR_mgmt_resource_group_name" \ -backend-config="storag...
AzureTRE/core/terraform/outputs.sh/0
{ "file_path": "AzureTRE/core/terraform/outputs.sh", "repo_id": "AzureTRE", "token_count": 487 }
101
#!/bin/bash set -euo pipefail # Use this for debug only # set -o xtrace # AZURE_CORE_OUTPUT=jsonc # force CLI output to JSON for the script (user can still change default for interactive usage in the dev container) function show_usage() { cat << USAGE Utility script for creating app registrations required by Azu...
AzureTRE/devops/scripts/aad/create_api_application.sh/0
{ "file_path": "AzureTRE/devops/scripts/aad/create_api_application.sh", "repo_id": "AzureTRE", "token_count": 5372 }
102
#!/bin/bash # This script cleans/deletes Azure environments created in CI. # A resource group will be evaluated if its name starts with aspecific prefix # and tagged with the 'ci_git_ref' tag. # If the RG was created as part of a PR, then it will be deleted if the PR # isn't open anymore. In all other cases (like regu...
AzureTRE/devops/scripts/clean_ci_validation_envs.sh/0
{ "file_path": "AzureTRE/devops/scripts/clean_ci_validation_envs.sh", "repo_id": "AzureTRE", "token_count": 1963 }
103
#!/usr/bin/env bash prs=$(gh pr list -s open -A app/dependabot -l javascript --json headRefName | jq ".[].headRefName"| tr -d '"') for pr in $prs do command="git merge upstream/$pr --no-edit" echo "$command" $command done
AzureTRE/devops/scripts/process_prs.sh/0
{ "file_path": "AzureTRE/devops/scripts/process_prs.sh", "repo_id": "AzureTRE", "token_count": 88 }
104
variable "mgmt_storage_account_name" { type = string description = "Storage account created by bootstrap to hold all Terraform state" } variable "mgmt_resource_group_name" { type = string description = "Shared management resource group" } variable "location" { type = string descriptio...
AzureTRE/devops/terraform/variables.tf/0
{ "file_path": "AzureTRE/devops/terraform/variables.tf", "repo_id": "AzureTRE", "token_count": 197 }
105
{ "$schema": "https://json-schema.org/draft/2019-09/schema", "type": "object", "properties": { "id": { "type": "string", "description": "Resource id.", "format": "uuid" }, "parentId": { "type": "string", "description": "Pare...
AzureTRE/docs/schemas/resource.json/0
{ "file_path": "AzureTRE/docs/schemas/resource.json", "repo_id": "AzureTRE", "token_count": 1982 }
106
# Getting Started This section provide the guidelines for any engineer to deploy AzureTRE. This how-to will enable one to get familiar with a TRE deployment and its concepts. !!! tip For troubleshooting purpose make sure to check the [Troubleshooting FAQ](../../troubleshooting-faq/index.md).
AzureTRE/docs/tre-admins/setup-instructions/index.md/0
{ "file_path": "AzureTRE/docs/tre-admins/setup-instructions/index.md", "repo_id": "AzureTRE", "token_count": 76 }
107
# Guacamole User Resource Service bundle (Linux) This is a User Resource Service template. It defines a Linux-based VM to be used by TRE researchers and to be connected to using a [Guacamole server](https://guacamole.apache.org/). It blocks all inbound and outbound traffic to the internet and allows only RDP connectio...
AzureTRE/docs/tre-templates/user-resources/guacamole-linux-vm.md/0
{ "file_path": "AzureTRE/docs/tre-templates/user-resources/guacamole-linux-vm.md", "repo_id": "AzureTRE", "token_count": 136 }
108
# Azure TRE base workspace The base workspace template is the foundation that all other workspaces and workspace services are built upon. Alternative workspace architectures could be used. However, the templates provided in this repository rely on the specific architecture of this base workspace. The base workspace t...
AzureTRE/docs/tre-templates/workspaces/base.md/0
{ "file_path": "AzureTRE/docs/tre-templates/workspaces/base.md", "repo_id": "AzureTRE", "token_count": 404 }
109
# Creating Custom templates This document will show how to create custom templates and integrate them into your CI/CD pipelines. ## Templates types There are 3 types of templates: 1. Workspace 1. Workspace Service 1. User Resource Read more about them [here](../../index.md#workspace) ## How to add custom template...
AzureTRE/docs/using-tre/templates/index.md/0
{ "file_path": "AzureTRE/docs/using-tre/templates/index.md", "repo_id": "AzureTRE", "token_count": 661 }
110
import pytest from httpx import AsyncClient from starlette import status import config from e2e_tests.conftest import clean_up_test_workspace, create_or_get_test_workspace from e2e_tests.resources.workspace import get_workspace from helpers import assert_status, get_auth_header, get_template from resources import str...
AzureTRE/e2e_tests/test_workspace_templates.py/0
{ "file_path": "AzureTRE/e2e_tests/test_workspace_templates.py", "repo_id": "AzureTRE", "token_count": 833 }
111
from typing import Optional from multiprocessing import Process import json import asyncio import logging import sys from resources.commands import azure_acr_login_command, azure_login_command, build_porter_command, build_porter_command_for_outputs, apply_porter_credentials_sets_command from shared.config import get_co...
AzureTRE/resource_processor/vmss_porter/runner.py/0
{ "file_path": "AzureTRE/resource_processor/vmss_porter/runner.py", "repo_id": "AzureTRE", "token_count": 4960 }
112
# syntax=docker/dockerfile-upstream:1.4.0 FROM --platform=linux/amd64 debian:bullseye-slim # PORTER_INIT SHELL ["/bin/bash", "-o", "pipefail", "-c"] 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 # Install jq RUN --mount=type=ca...
AzureTRE/templates/shared_services/airlock_notifier/Dockerfile.tmpl/0
{ "file_path": "AzureTRE/templates/shared_services/airlock_notifier/Dockerfile.tmpl", "repo_id": "AzureTRE", "token_count": 267 }
113
resource "azurerm_firewall_policy_rule_collection_group" "core_airlock_notifier" { name = "rcg-core-airlock-notifier" firewall_policy_id = data.azurerm_firewall_policy.core.id priority = 501 network_rule_collection { name = "nrc-resource-processor-appservice-deployment" prio...
AzureTRE/templates/shared_services/airlock_notifier/terraform/rules.tf/0
{ "file_path": "AzureTRE/templates/shared_services/airlock_notifier/terraform/rules.tf", "repo_id": "AzureTRE", "token_count": 291 }
114
output "fqdn" { value = azurerm_public_ip.appgwpip.fqdn } output "application_gateway_name" { value = azurerm_application_gateway.agw.name } output "storage_account_name" { value = azurerm_storage_account.staticweb.name } output "resource_group_name" { value = azurerm_application_gateway.agw.resource_group_n...
AzureTRE/templates/shared_services/certs/terraform/outputs.tf/0
{ "file_path": "AzureTRE/templates/shared_services/certs/terraform/outputs.tf", "repo_id": "AzureTRE", "token_count": 158 }
115
variable "tre_id" { type = string } variable "tre_resource_id" { type = string } variable "arm_environment" { type = string }
AzureTRE/templates/shared_services/cyclecloud/terraform/variables.tf/0
{ "file_path": "AzureTRE/templates/shared_services/cyclecloud/terraform/variables.tf", "repo_id": "AzureTRE", "token_count": 46 }
116
#!/bin/bash # This script exists to support the migration from the firewall into a shared service bundle, that can be deployed from a dev workstation. set -e PLAN_FILE="tfplan$$" TS=$(date +"%s") LOG_FILE="${TS}-tre-${SHARED_SERVICE_KEY}.log" LOC="$(dirname -- "$(readlink -f "${BASH_SOURCE}")")" ${LOC}/../../devop...
AzureTRE/templates/shared_services/deploy_from_local.sh/0
{ "file_path": "AzureTRE/templates/shared_services/deploy_from_local.sh", "repo_id": "AzureTRE", "token_count": 279 }
117
output "gitea_fqdn" { value = azurerm_linux_web_app.gitea.default_hostname } output "address_prefixes" { value = jsonencode(data.azurerm_subnet.web_app.address_prefixes) } output "gitea_allowed_fqdns_list" { value = jsonencode(local.gitea_allowed_fqdns_list) } output "connection_uri" { value = "https://${azu...
AzureTRE/templates/shared_services/gitea/terraform/outputs.tf/0
{ "file_path": "AzureTRE/templates/shared_services/gitea/terraform/outputs.tf", "repo_id": "AzureTRE", "token_count": 175 }
118
{ "name": "docker-hub", "online": true, "storage": { "blobStoreName": "default", "strictContentTypeValidation": true, "write_policy": "ALLOW" }, "proxy": { "remoteUrl": "https://registry-1.docker.io", "contentMaxAge": 1440, "metadataMaxAge": 1440 }, "dockerProxy": { ...
AzureTRE/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/docker_hub_proxy_conf.json/0
{ "file_path": "AzureTRE/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/docker_hub_proxy_conf.json", "repo_id": "AzureTRE", "token_count": 404 }
119
locals { core_vnet = "vnet-${var.tre_id}" core_resource_group_name = "rg-${var.tre_id}" nexus_allowed_fqdns = "pypi.org,*.pypi.org,files.pythonhosted.org,security.ubuntu.com,archive.ubuntu.com,keyserver.ubuntu.com,repo.anaconda.com,*.docker.com,*.docker.io,conda.anaconda.o...
AzureTRE/templates/shared_services/sonatype-nexus-vm/terraform/locals.tf/0
{ "file_path": "AzureTRE/templates/shared_services/sonatype-nexus-vm/terraform/locals.tf", "repo_id": "AzureTRE", "token_count": 448 }
120
#!/bin/bash set -euo pipefail eval "$(jq -r '@sh "AUTH_CLIENT_ID=\(.auth_client_id) AUTH_CLIENT_SECRET=\(.auth_client_secret) AUTH_TENANT_ID=\(.auth_tenant_id) WORSKPACE_CLIENT_ID=\(.workspace_client_id)"')" az cloud set --name "$AZURE_ENVIRONMENT" az login --allow-no-subscriptions --service-principal --username "$...
AzureTRE/templates/workspace_services/azureml/terraform/get_app_role_members.sh/0
{ "file_path": "AzureTRE/templates/workspace_services/azureml/terraform/get_app_role_members.sh", "repo_id": "AzureTRE", "token_count": 459 }
121
# Using AzApi due to https://github.com/hashicorp/terraform-provider-azurerm/issues/15362 resource "azapi_resource" "compute_instance" { type = "Microsoft.MachineLearningServices/workspaces/computes@2022-06-01-preview" name = local.aml_compute_instance_name location ...
AzureTRE/templates/workspace_services/azureml/user_resources/aml_compute/terraform/compute.tf/0
{ "file_path": "AzureTRE/templates/workspace_services/azureml/user_resources/aml_compute/terraform/compute.tf", "repo_id": "AzureTRE", "token_count": 546 }
122
{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "https://github.com/microsoft/AzureTRE/templates/workspace_services/guacamole/template_schema.json", "type": "object", "title": "Gitea", "description": "Gitea is a lightweight DevOps platform. Features include code hosting, code review, CI/CD, proj...
AzureTRE/templates/workspace_services/gitea/template_schema.json/0
{ "file_path": "AzureTRE/templates/workspace_services/gitea/template_schema.json", "repo_id": "AzureTRE", "token_count": 4645 }
123
FROM maven:3-jdk-11-slim AS client_build COPY ./guacamole-auth-azure/pom.xml /pom.xml # cache dependencies in a separate layer RUN mvn package -Dmaven.test.skip COPY ./guacamole-auth-azure/src /src COPY ./docker/maven_package_and_exit_succesfully.sh /tmp/ RUN bash /tmp/maven_package_and_exit_succesfully.sh FROM scra...
AzureTRE/templates/workspace_services/guacamole/guacamole-server/docker/Dockerfile/0
{ "file_path": "AzureTRE/templates/workspace_services/guacamole/guacamole-server/docker/Dockerfile", "repo_id": "AzureTRE", "token_count": 1253 }
124
# Guacamole Authorization Extension This extension is built (maven) and is placed inside the extension directory. Guacamole tries to authorize using all the given extensions. Read more [here](https://guacamole.apache.org/doc/gug/guacamole-ext.html). ## TRE Authorization extension This extension works in the followin...
AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/readme.md/0
{ "file_path": "AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/readme.md", "repo_id": "AzureTRE", "token_count": 423 }
125
package org.apache.guacamole.auth.azuretre.connection; import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.auth.azuretre.user.AzureTREAuthenticatedUser; import org.apache.guacamole.net.auth.AuthenticatedUser; import org.apache.guacamole.net.auth.Connection; import org.junit.jupiter.api.Test; im...
AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/src/test/java/org/apache/guacamole/auth/azuretre/connection/ConnectionServiceTest.java/0
{ "file_path": "AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/src/test/java/org/apache/guacamole/auth/azuretre/connection/ConnectionServiceTest.java", "repo_id": "AzureTRE", "token_count": 647 }
126
# Guacamole User Resources This folder contains user resources that can be deployed with the Guacamole workspace service: - linuxvm - a Linux-based virtual machine (expects an Ubuntu 18.04-based VM) - windowsvm - A Windows-based virtual machine ## Customising the user resources The `guacamole-azure-linuxvm` and `g...
AzureTRE/templates/workspace_services/guacamole/user_resources/README.md/0
{ "file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/README.md", "repo_id": "AzureTRE", "token_count": 1822 }
127
output "ip" { value = azurerm_network_interface.internal.private_ip_address } output "hostname" { value = azurerm_windows_virtual_machine.windowsvm.name } output "azure_resource_id" { value = azurerm_windows_virtual_machine.windowsvm.id } output "connection_uri" { value = "https://${data.azurerm_linux_web_ap...
AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-export-reviewvm/terraform/outputs.tf/0
{ "file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-export-reviewvm/terraform/outputs.tf", "repo_id": "AzureTRE", "token_count": 245 }
128
{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "https://github.com/microsoft/AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/template_schema.json", "type": "object", "title": "Windows Virtual Machine", "description": "Windows virtual machine.",...
AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/template_schema.json/0
{ "file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-windowsvm/template_schema.json", "repo_id": "AzureTRE", "token_count": 624 }
129
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 = "rg-${var.tre_id}-ws-${local.short_workspace_id}" } data "azurerm_key_vault" "ws" ...
AzureTRE/templates/workspace_services/health-services/terraform/data.tf/0
{ "file_path": "AzureTRE/templates/workspace_services/health-services/terraform/data.tf", "repo_id": "AzureTRE", "token_count": 539 }
130
{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "https://github.com/microsoft/AzureTRE/templates/workspace_services/innereye/template_schema.json", "type": "object", "title": "InnerEye service template", "description": "Installs Azure ML and InnerEye components. Please be aware this te...
AzureTRE/templates/workspace_services/innereye/template_schema.json/0
{ "file_path": "AzureTRE/templates/workspace_services/innereye/template_schema.json", "repo_id": "AzureTRE", "token_count": 385 }
131
mlflow server \ --backend-store-uri "$MLFLOW_SERVER_FILE_STORE" \ --default-artifact-root "$MLFLOW_SERVER_DEFAULT_ARTIFACT_ROOT" \ --host "$MLFLOW_SERVER_HOST" \ --port "$MLFLOW_SERVER_PORT" \ --workers "$MLFLOW_SERVER_WORKERS"
AzureTRE/templates/workspace_services/mlflow/mlflow-server/docker/startup.sh/0
{ "file_path": "AzureTRE/templates/workspace_services/mlflow/mlflow-server/docker/startup.sh", "repo_id": "AzureTRE", "token_count": 113 }
132
variable "workspace_id" { type = string } variable "tre_id" { type = string } variable "tre_resource_id" { type = string } variable "mgmt_acr_name" { type = string } variable "mgmt_resource_group_name" { type = string } variable "is_exposed_externally" { type = bool description = "Is the webapp a...
AzureTRE/templates/workspace_services/mlflow/terraform/variables.tf/0
{ "file_path": "AzureTRE/templates/workspace_services/mlflow/terraform/variables.tf", "repo_id": "AzureTRE", "token_count": 154 }
133
ID="__CHANGE_ME__" WORKSPACE_ID="__CHANGE_ME__" TRE_ID="__CHANGE_ME__" MGMT_RESOURCE_GROUP_NAME="__CHANGE_ME__" MGMT_ACR_NAME="__CHANGE_ME__"
AzureTRE/templates/workspace_services/ohdsi/.env.sample/0
{ "file_path": "AzureTRE/templates/workspace_services/ohdsi/.env.sample", "repo_id": "AzureTRE", "token_count": 71 }
134
{ "$schema": "http://json-schema.org/draft-07/schema", "$id": "https://github.com/microsoft/AzureTRE/templates/workspace_services/ohdsi/template_schema.json", "type": "object", "title": "OHDSI Workspace Service", "description": "Provides OHDSI within the workspace", "required": [], "properties": { "di...
AzureTRE/templates/workspace_services/ohdsi/template_schema.json/0
{ "file_path": "AzureTRE/templates/workspace_services/ohdsi/template_schema.json", "repo_id": "AzureTRE", "token_count": 6895 }
135
output "app_role_workspace_owner_id" { value = random_uuid.app_role_workspace_owner_id.result } output "app_role_workspace_researcher_id" { value = random_uuid.app_role_workspace_researcher_id.result } output "app_role_workspace_airlock_manager_id" { value = random_uuid.app_role_workspace_airlock_manager_id.res...
AzureTRE/templates/workspaces/base/terraform/aad/outputs.tf/0
{ "file_path": "AzureTRE/templates/workspaces/base/terraform/aad/outputs.tf", "repo_id": "AzureTRE", "token_count": 217 }
136
#!/bin/bash set -e # This script is not used and is left here for you to debug the creation of the workspace # at a Terraform level without having to interact with Porter # This script assumes you have created an .env from the sample and the variables # will come from there. # shellcheck disable=SC2154 terraform init...
AzureTRE/templates/workspaces/base/terraform/deploy.sh/0
{ "file_path": "AzureTRE/templates/workspaces/base/terraform/deploy.sh", "repo_id": "AzureTRE", "token_count": 239 }
137
variable "tre_id" { type = string description = "Unique TRE ID" } variable "tre_resource_id" { type = string description = "Resource ID" } variable "shared_storage_quota" { type = number default = 50 description = "Quota (in GB) to set for the VM Shared Storage." } variable "lo...
AzureTRE/templates/workspaces/base/terraform/variables.tf/0
{ "file_path": "AzureTRE/templates/workspaces/base/terraform/variables.tf", "repo_id": "AzureTRE", "token_count": 1273 }
138
import { Dialog, DialogFooter, PrimaryButton, DialogType, Spinner, Dropdown, MessageBar, MessageBarType, Icon } from '@fluentui/react'; import React, { useContext, useState } from 'react'; import { AvailableUpgrade, Resource } from '../../models/resource'; import { HttpMethod, ResultType, useAuthApiCall } from '../../h...
AzureTRE/ui/app/src/components/shared/ConfirmUpgradeResource.tsx/0
{ "file_path": "AzureTRE/ui/app/src/components/shared/ConfirmUpgradeResource.tsx", "repo_id": "AzureTRE", "token_count": 1658 }
139
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 { Operation } from '../../models/operation'; import {...
AzureTRE/ui/app/src/components/shared/ResourceOperationsList.tsx/0
{ "file_path": "AzureTRE/ui/app/src/components/shared/ResourceOperationsList.tsx", "repo_id": "AzureTRE", "token_count": 1646 }
140
import React, { useEffect, useState } from 'react'; import { Icon, ProgressIndicator, Link as FluentLink, Stack, DefaultPalette, Shimmer, ShimmerElementType } from '@fluentui/react'; import { TRENotification } from '../../../models/treNotification'; import { awaitingStates, completedStates, failedStates, inProgressStat...
AzureTRE/ui/app/src/components/shared/notifications/NotificationItem.tsx/0
{ "file_path": "AzureTRE/ui/app/src/components/shared/notifications/NotificationItem.tsx", "repo_id": "AzureTRE", "token_count": 3328 }
141
import { createContext } from "react"; import { CostResource } from "../models/costs"; import { LoadingState } from "../models/loadingState"; export const CostsContext = createContext({ costs: [] as Array<CostResource>, loadingState: {} as LoadingState, setCosts: (costs: Array<CostResource>) => { }, setLoading...
AzureTRE/ui/app/src/contexts/CostsContext.ts/0
{ "file_path": "AzureTRE/ui/app/src/contexts/CostsContext.ts", "repo_id": "AzureTRE", "token_count": 105 }
142
export enum RoleName { TREAdmin = "TREAdmin", TREUser = "TREUser" } export enum WorkspaceRoleName { WorkspaceOwner = "WorkspaceOwner", WorkspaceResearcher = "WorkspaceResearcher", AirlockManager = "AirlockManager" }
AzureTRE/ui/app/src/models/roleNames.ts/0
{ "file_path": "AzureTRE/ui/app/src/models/roleNames.ts", "repo_id": "AzureTRE", "token_count": 85 }
143
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import os import sys import json data_dir=sys.argv[1] def sort_triples(triples, text): sorted_triples = sorted(triples, key=lambda x:text.find(x['drug'])) return sorted_triples def build_target_seq_relis(triples): answer ...
BioGPT/examples/RE-DDI/rebuild_data.py/0
{ "file_path": "BioGPT/examples/RE-DDI/rebuild_data.py", "repo_id": "BioGPT", "token_count": 1111 }
144
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import logging import numpy as np import torch from fairseq.data import FairseqDataset, data_utils logger = logging.getLogger(__name__) def collate(samples, pad_idx, eos_idx, prefix=False, sep_idx=None, prompt=None): if len(samples) == 0...
BioGPT/src/language_model_prompt_dataset.py/0
{ "file_path": "BioGPT/src/language_model_prompt_dataset.py", "repo_id": "BioGPT", "token_count": 3441 }
145
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #ifndef __LADDER_KERNEL_H__ #define __LADDER_KERNEL_H__ #include <cuda_fp16.h> #if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ == 800) #define TVM_ENABLE_L2_PREFETCH 1 #else #define TVM_ENABLE_L2_PREFETCH 0 #endif #ifdef _WIN32 using uint = uns...
BitBLAS/integration/bitdistiller/kenrel_output/ladder_kernel.h/0
{ "file_path": "BitBLAS/integration/bitdistiller/kenrel_output/ladder_kernel.h", "repo_id": "BitBLAS", "token_count": 6264 }
146
Please checkout https://github.com/LeiWang1999/vllm-bitblas for details currently. The relative pull request to the official vLLM is still under construction.
BitBLAS/integration/vLLM/README.md/0
{ "file_path": "BitBLAS/integration/vLLM/README.md", "repo_id": "BitBLAS", "token_count": 41 }
147
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import tvm from tvm.target import Target from .arch_base import TileDevice # For LLVM Backend, we do not provide the detailed information of the CPU # As the LLVM backend do not required tuning, just maintain the consistency class CPU(TileDevic...
BitBLAS/python/bitblas/base/roller/arch/cpu.py/0
{ "file_path": "BitBLAS/python/bitblas/base/roller/arch/cpu.py", "repo_id": "BitBLAS", "token_count": 202 }
148
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from .operator import ( global_operator_cache, # noqa: F401 load_global_ops_cache, # noqa: F401 get_database_path, # noqa: F401 set_database_path, # noqa: F401 )
BitBLAS/python/bitblas/cache/__init__.py/0
{ "file_path": "BitBLAS/python/bitblas/cache/__init__.py", "repo_id": "BitBLAS", "token_count": 96 }
149
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # pylint: disable=missing-docstring, invalid-name """A GEMM schedule rule for GPU operators.""" from typing import Literal, Optional from tvm import DataType, tir from tvm.target import Target from ..base.roller.rasterization import NoRasteriza...
BitBLAS/python/bitblas/gpu/matmul_wmma.py/0
{ "file_path": "BitBLAS/python/bitblas/gpu/matmul_wmma.py", "repo_id": "BitBLAS", "token_count": 17200 }
150
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from tvm.target import Target from typing import Literal, Union from .operator import Operator from .impl.lop3_permutate_impl import select_implementation from dataclasses import dataclass import torch @dataclass(frozen=True) class LOP3Permutate...
BitBLAS/python/bitblas/ops/lop3_permutate.py/0
{ "file_path": "BitBLAS/python/bitblas/ops/lop3_permutate.py", "repo_id": "BitBLAS", "token_count": 814 }
151
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import tvm from typing import Union from enum import IntEnum import numpy as np import torch from torch.utils.dlpack import from_dlpack, to_dlpack from math import prod from tvm.relay import TensorType from tvm._ffi.base import _LIB, c_str from t...
BitBLAS/python/bitblas/utils/tensor_adapter.py/0
{ "file_path": "BitBLAS/python/bitblas/utils/tensor_adapter.py", "repo_id": "BitBLAS", "token_count": 2316 }
152
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import pytest import bitblas from bitblas import MatmulConfig, Matmul import logging from bitblas import set_log_level set_log_level(logging.DEBUG) @pytest.mark.parametrize( "M,N,K,A_dtype,W_dtype,accum_dtype,out_dtype,layout,with_bias,grou...
BitBLAS/testing/python/operators/test_general_matmul_fp8.py/0
{ "file_path": "BitBLAS/testing/python/operators/test_general_matmul_fp8.py", "repo_id": "BitBLAS", "token_count": 1367 }
153
date ; hostname ; pwd export MASTER_ADDR=$HOSTNAME export MASTER_PORT=19800 export NODE_RANK=0 EXP_LR_ARRAY=(1e-5 2e-5 1e-5 2e-5) EXP_BS_ARRAY=(16 16 32 32) EXP_TN_ARRAY1=(cola mrpc sst2 qqp) EXP_TN_ARRAY2=(stsb rte qnli mnli) EXP_CUDA_INDEX1=(0 1 2 3) EXP_CUDA_INDEX2=(4 5 6 7) EXP_MASTER_PORT1=(19800 19801 19802 198...
BridgeTower/scripts/ftfpt_glue.sh/0
{ "file_path": "BridgeTower/scripts/ftfpt_glue.sh", "repo_id": "BridgeTower", "token_count": 1102 }
154
from ..datasets import NLVR2Dataset from .datamodule_base import BaseDataModule class NLVR2DataModule(BaseDataModule): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) @property def dataset_cls(self): return NLVR2Dataset @property def dataset_name(self): ...
BridgeTower/src/datamodules/nlvr2_datamodule.py/0
{ "file_path": "BridgeTower/src/datamodules/nlvr2_datamodule.py", "repo_id": "BridgeTower", "token_count": 142 }
155
import torch from torchmetrics import Metric class Accuracy(Metric): def __init__(self, dist_sync_on_step=False): super().__init__(dist_sync_on_step=dist_sync_on_step) self.add_state("correct", default=torch.tensor(0.0), dist_reduce_fx="sum") self.add_state("total", default=torch.tensor(0....
BridgeTower/src/gadgets/my_metrics.py/0
{ "file_path": "BridgeTower/src/gadgets/my_metrics.py", "repo_id": "BridgeTower", "token_count": 1078 }
156
from .utils import ( inception_normalize, imagenet_normalize, MinMaxResize, ) from PIL import Image from torchvision import transforms from torchvision.transforms import Compose, Resize, CenterCrop, ToTensor, Normalize, RandomResizedCrop, RandomHorizontalFlip from .randaug import RandAugment from .randaugme...
BridgeTower/src/transforms/transform.py/0
{ "file_path": "BridgeTower/src/transforms/transform.py", "repo_id": "BridgeTower", "token_count": 2767 }
157
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import argparse import gc import json import os import time import warnings import numpy as np import torch import torch.nn.functional as F import torchvision as tv from PIL import Image, ImageFile from detection_models import networks from det...
Bringing-Old-Photos-Back-to-Life/Global/detection.py/0
{ "file_path": "Bringing-Old-Photos-Back-to-Life/Global/detection.py", "repo_id": "Bringing-Old-Photos-Back-to-Life", "token_count": 2295 }
158
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from .base_options import BaseOptions class TrainOptions(BaseOptions): def initialize(self): BaseOptions.initialize(self) # for displays self.parser.add_argument('--display_freq', type=int, default=100, help='frequenc...
Bringing-Old-Photos-Back-to-Life/Global/options/train_options.py/0
{ "file_path": "Bringing-Old-Photos-Back-to-Life/Global/options/train_options.py", "repo_id": "Bringing-Old-Photos-Back-to-Life", "token_count": 1766 }
159
from __future__ import annotations from pathlib import Path import warnings warnings.filterwarnings("ignore") import random import torchaudio import collections import re import numpy as np from transformers import AutoTokenizer, logging from .models.clap import CLAP from .models.mapper import get_clapcap import math ...
CLAP/msclap/CLAPWrapper.py/0
{ "file_path": "CLAP/msclap/CLAPWrapper.py", "repo_id": "CLAP", "token_count": 9467 }
160
.. role:: hidden :class: hidden-section .. _optimizers: Optimizers ========== Optimizers update the Model parameters based on the gradients. .. automodule:: fairseq.optim :members: .. autoclass:: fairseq.optim.FairseqOptimizer :members: :undoc-members: .. autoclass:: fairseq.optim.adadelta.Adadelt...
COCO-LM/fairseq/docs/optim.rst/0
{ "file_path": "COCO-LM/fairseq/docs/optim.rst", "repo_id": "COCO-LM", "token_count": 346 }
161
#!/usr/bin/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 fileinput import hashlib import sys from multiprocessing import Pool def get_hashes_and_lines(raw_...
COCO-LM/fairseq/examples/backtranslation/deduplicate_lines.py/0
{ "file_path": "COCO-LM/fairseq/examples/backtranslation/deduplicate_lines.py", "repo_id": "COCO-LM", "token_count": 511 }
162
#!/usr/bin/env python3 # # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import sys from sacremoses.normalize import MosesPunctNormalizer def main(args): normalizer = MosesPunctNormal...
COCO-LM/fairseq/examples/constrained_decoding/normalize.py/0
{ "file_path": "COCO-LM/fairseq/examples/constrained_decoding/normalize.py", "repo_id": "COCO-LM", "token_count": 241 }
163
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import Dict, List, Optional import math import numpy as np import torch import torch.nn.functional as F from torch import Tensor...
COCO-LM/fairseq/examples/fast_noisy_channel/noisy_channel_sequence_generator.py/0
{ "file_path": "COCO-LM/fairseq/examples/fast_noisy_channel/noisy_channel_sequence_generator.py", "repo_id": "COCO-LM", "token_count": 21564 }
164
# Deep Transformers with Latent Depth (Li et al., 2020) [https://arxiv.org/abs/2009.13102](https://arxiv.org/abs/2009.13102). ## Introduction We present a probabilistic framework to automatically learn which layer(s) to use by learning the posterior distributions of layer selection. As an extension of this framework...
COCO-LM/fairseq/examples/latent_depth/README.md/0
{ "file_path": "COCO-LM/fairseq/examples/latent_depth/README.md", "repo_id": "COCO-LM", "token_count": 1061 }
165
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import torch.nn as nn from fairseq.models.transformer import TransformerEncoder from .linformer_sentence_encoder_layer import Li...
COCO-LM/fairseq/examples/linformer/linformer_src/modules/linformer_sentence_encoder.py/0
{ "file_path": "COCO-LM/fairseq/examples/linformer/linformer_src/modules/linformer_sentence_encoder.py", "repo_id": "COCO-LM", "token_count": 768 }
166