text stringlengths 5 22M | id stringlengths 12 177 | metadata dict | __index_level_0__ int64 0 1.37k |
|---|---|---|---|
# coding=utf-8
# Copyright 2018 The HuggingFace Inc. team, Microsoft Corporation.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License ... | AdaMix/src/transformers/models/mpnet/tokenization_mpnet.py/0 | {
"file_path": "AdaMix/src/transformers/models/mpnet/tokenization_mpnet.py",
"repo_id": "AdaMix",
"token_count": 9987
} | 61 |
# 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/src/transformers/models/openai/convert_openai_original_tf_checkpoint_to_pytorch.py/0 | {
"file_path": "AdaMix/src/transformers/models/openai/convert_openai_original_tf_checkpoint_to_pytorch.py",
"repo_id": "AdaMix",
"token_count": 969
} | 62 |
# coding=utf-8
# Copyright 2020 Google and The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | AdaMix/src/transformers/models/pegasus/tokenization_pegasus_fast.py/0 | {
"file_path": "AdaMix/src/transformers/models/pegasus/tokenization_pegasus_fast.py",
"repo_id": "AdaMix",
"token_count": 3907
} | 63 |
# 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/src/transformers/models/reformer/convert_reformer_trax_checkpoint_to_pytorch.py/0 | {
"file_path": "AdaMix/src/transformers/models/reformer/convert_reformer_trax_checkpoint_to_pytorch.py",
"repo_id": "AdaMix",
"token_count": 3189
} | 64 |
# coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | AdaMix/src/transformers/models/speech_to_text/configuration_speech_to_text.py/0 | {
"file_path": "AdaMix/src/transformers/models/speech_to_text/configuration_speech_to_text.py",
"repo_id": "AdaMix",
"token_count": 3954
} | 65 |
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | AdaMix/src/transformers/models/transfo_xl/modeling_transfo_xl_utilities.py/0 | {
"file_path": "AdaMix/src/transformers/models/transfo_xl/modeling_transfo_xl_utilities.py",
"repo_id": "AdaMix",
"token_count": 5567
} | 66 |
# coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | AdaMix/src/transformers/models/xlnet/configuration_xlnet.py/0 | {
"file_path": "AdaMix/src/transformers/models/xlnet/configuration_xlnet.py",
"repo_id": "AdaMix",
"token_count": 4533
} | 67 |
import numpy as np
from ..file_utils import add_end_docstrings, is_tf_available, is_torch_available
from .base import PIPELINE_INIT_ARGS, Pipeline
if is_tf_available():
from ..models.auto.modeling_tf_auto import TF_MODEL_FOR_SEQUENCE_CLASSIFICATION_MAPPING
if is_torch_available():
from ..models.auto.modelin... | AdaMix/src/transformers/pipelines/text_classification.py/0 | {
"file_path": "AdaMix/src/transformers/pipelines/text_classification.py",
"repo_id": "AdaMix",
"token_count": 1270
} | 68 |
# coding=utf-8
# Copyright 2020-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 ap... | AdaMix/src/transformers/trainer_utils.py/0 | {
"file_path": "AdaMix/src/transformers/trainer_utils.py",
"repo_id": "AdaMix",
"token_count": 6081
} | 69 |
# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..file_utils import requires_tokenizers
class AlbertTokenizerFast:
def __init__(self, *args, **kwargs):
requires_tokenizers(self)
@classmethod
def from_pretrained(self, *args, **kwargs):
requires_tokenizers(s... | AdaMix/src/transformers/utils/dummy_tokenizers_objects.py/0 | {
"file_path": "AdaMix/src/transformers/utils/dummy_tokenizers_objects.py",
"repo_id": "AdaMix",
"token_count": 2840
} | 70 |
# coding=utf-8
# Copyright 2021 {{cookiecutter.authors}} and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lice... | AdaMix/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py/0 | {
"file_path": "AdaMix/templates/adding_a_new_model/cookiecutter-template-{{cookiecutter.modelname}}/modeling_tf_{{cookiecutter.lowercase_modelname}}.py",
"repo_id": "AdaMix",
"token_count": 57328
} | 71 |
{
"modelname": "NewTFENCDEC",
"uppercase_modelname": "NEW_TF_ENC_DEC",
"lowercase_modelname": "new_tf_enc_dec",
"camelcase_modelname": "NewTFEncDec",
"authors": "The HuggingFace Team",
"checkpoint_identifier": "new-tf-enc-dec-base",
"tokenizer_type": "Based on BART",
"generate_tensorflow_and_pytorch": "... | AdaMix/templates/adding_a_new_model/tests/tf-seq-2-seq-bart-tokenizer.json/0 | {
"file_path": "AdaMix/templates/adding_a_new_model/tests/tf-seq-2-seq-bart-tokenizer.json",
"repo_id": "AdaMix",
"token_count": 152
} | 72 |
# coding=utf-8
# Copyright 2019 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_configuration_common.py/0 | {
"file_path": "AdaMix/tests/test_configuration_common.py",
"repo_id": "AdaMix",
"token_count": 1289
} | 73 |
# coding=utf-8
# Copyright 2020 The Hugging Face 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 law... | AdaMix/tests/test_model_output.py/0 | {
"file_path": "AdaMix/tests/test_model_output.py",
"repo_id": "AdaMix",
"token_count": 1546
} | 74 |
# coding=utf-8
# Copyright 2020 Huggingface
#
# 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 agreed ... | AdaMix/tests/test_modeling_dpr.py/0 | {
"file_path": "AdaMix/tests/test_modeling_dpr.py",
"repo_id": "AdaMix",
"token_count": 5190
} | 75 |
# coding=utf-8
# Copyright 2021, The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | AdaMix/tests/test_modeling_marian.py/0 | {
"file_path": "AdaMix/tests/test_modeling_marian.py",
"repo_id": "AdaMix",
"token_count": 12859
} | 76 |
# 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_auto.py/0 | {
"file_path": "AdaMix/tests/test_modeling_tf_auto.py",
"repo_id": "AdaMix",
"token_count": 3864
} | 77 |
# coding=utf-8
# Copyright Iz Beltagy, Matthew E. Peters, Arman Cohan and The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.ap... | AdaMix/tests/test_modeling_tf_led.py/0 | {
"file_path": "AdaMix/tests/test_modeling_tf_led.py",
"repo_id": "AdaMix",
"token_count": 8634
} | 78 |
# 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_xlm_roberta.py/0 | {
"file_path": "AdaMix/tests/test_modeling_tf_xlm_roberta.py",
"repo_id": "AdaMix",
"token_count": 842
} | 79 |
# 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_ner.py/0 | {
"file_path": "AdaMix/tests/test_pipelines_ner.py",
"repo_id": "AdaMix",
"token_count": 9492
} | 80 |
# 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_tokenization_bart.py/0 | {
"file_path": "AdaMix/tests/test_tokenization_bart.py",
"repo_id": "AdaMix",
"token_count": 3748
} | 81 |
# 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_gpt2.py/0 | {
"file_path": "AdaMix/tests/test_tokenization_gpt2.py",
"repo_id": "AdaMix",
"token_count": 3241
} | 82 |
#!/usr/bin/env python3
# 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/LICENS... | AdaMix/tests/test_tokenization_small_blenderbot.py/0 | {
"file_path": "AdaMix/tests/test_tokenization_small_blenderbot.py",
"repo_id": "AdaMix",
"token_count": 1479
} | 83 |
# 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_trainer_tpu.py/0 | {
"file_path": "AdaMix/tests/test_trainer_tpu.py",
"repo_id": "AdaMix",
"token_count": 1668
} | 84 |
## Race Monitoring
As a drone is navigating the racetrack, the race progress is streamed to a local log file, which can be found at `ADRL/Saved/Logs/RaceLogs/[TimeStamp]_[Level]_tier_[Tier#]_[Race#].log`.
This log is updated with data such as the current odometry of the drone, number of gates passed/missed, timesta... | AirSim-Drone-Racing-Lab/docs/race_monitoring.md/0 | {
"file_path": "AirSim-Drone-Racing-Lab/docs/race_monitoring.md",
"repo_id": "AirSim-Drone-Racing-Lab",
"token_count": 271
} | 85 |
from __future__ import division
import numpy as np
import random
import math
import time
import airsimdroneracingvae.types
import airsimdroneracingvae.utils
from airsimdroneracingvae.types import Pose, Vector3r, Quaternionr
from airsimdroneracingvae.utils import to_eularian_angles, to_quaternion
def MoveCheckeredGates... | AirSim-Drone-Racing-VAE-Imitation/racing_utils/trajectory_utils.py/0 | {
"file_path": "AirSim-Drone-Racing-VAE-Imitation/racing_utils/trajectory_utils.py",
"repo_id": "AirSim-Drone-Racing-VAE-Imitation",
"token_count": 3056
} | 86 |
from argparse import ArgumentParser
import airsimneurips as airsim
import cv2
import threading
import time
import utils
import numpy as np
import math
# drone_name should match the name in ~/Document/AirSim/settings.json
class BaselineRacer(object):
def __init__(self, drone_name = "drone_1", viz_traj=True, viz_tra... | AirSim-NeurIPS2019-Drone-Racing/baselines/baseline_racer.py/0 | {
"file_path": "AirSim-NeurIPS2019-Drone-Racing/baselines/baseline_racer.py",
"repo_id": "AirSim-NeurIPS2019-Drone-Racing",
"token_count": 7400
} | 87 |
import airsimneurips
import threading
import time
class ReproduceResetRaceCondition():
def __init__(self, drone_name = "drone_1"):
self.airsim_client = airsimneurips.MultirotorClient()
self.airsim_client_2 = airsimneurips.MultirotorClient()
self.airsim_client_3 = airsimneurips.MultirotorCli... | AirSim-NeurIPS2019-Drone-Racing/tests/test_reset.py/0 | {
"file_path": "AirSim-NeurIPS2019-Drone-Racing/tests/test_reset.py",
"repo_id": "AirSim-NeurIPS2019-Drone-Racing",
"token_count": 1810
} | 88 |
# Contributing
Please read the [Contributing](https://microsoft.github.io/AzureTRE/contributing/) guidelines in the documentation site. | AzureTRE/CONTRIBUTING.md/0 | {
"file_path": "AzureTRE/CONTRIBUTING.md",
"repo_id": "AzureTRE",
"token_count": 34
} | 89 |
# PYTHON
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually ... | AzureTRE/api_app/.dockerignore/0 | {
"file_path": "AzureTRE/api_app/.dockerignore",
"repo_id": "AzureTRE",
"token_count": 743
} | 90 |
from typing import List
import uuid
from pydantic import parse_obj_as
from db.errors import EntityDoesNotExist
from db.repositories.base import BaseRepository
from core import config
from models.domain.resource import Resource, ResourceHistoryItem
from services.logging import logger
class ResourceHistoryRepository(B... | AzureTRE/api_app/db/repositories/resources_history.py/0 | {
"file_path": "AzureTRE/api_app/db/repositories/resources_history.py",
"repo_id": "AzureTRE",
"token_count": 973
} | 91 |
from datetime import datetime, timedelta, date
from typing import List, Optional
from pydantic import BaseModel
from enum import Enum
import random
import uuid
class GranularityEnum(str, Enum):
daily = "Daily"
none = "None"
class CurrencyEnum(str, Enum):
USD = "USD"
ILS = "ILS"
def generate_cost_r... | AzureTRE/api_app/models/domain/costs.py/0 | {
"file_path": "AzureTRE/api_app/models/domain/costs.py",
"repo_id": "AzureTRE",
"token_count": 1628
} | 92 |
from datetime import datetime
from pydantic import BaseModel
class Pong(BaseModel):
message: str
time: datetime
| AzureTRE/api_app/models/schemas/health.py/0 | {
"file_path": "AzureTRE/api_app/models/schemas/health.py",
"repo_id": "AzureTRE",
"token_count": 40
} | 93 |
from typing import Union
from resources import strings
from models.domain.resource_template import PipelineStep
from models.domain.resource import Resource
def substitute_properties(template_step: PipelineStep, primary_resource: Resource, primary_parent_workspace: Resource, primary_parent_workspace_svc: Resource, res... | AzureTRE/api_app/service_bus/substitutions.py/0 | {
"file_path": "AzureTRE/api_app/service_bus/substitutions.py",
"repo_id": "AzureTRE",
"token_count": 2987
} | 94 |
import json
import pytest
from mock import patch
from pydantic import parse_obj_as
from starlette import status
from services.authentication import get_current_admin_user, get_current_tre_user_or_tre_admin
from models.domain.resource import ResourceType
from resources import strings
from db.errors import DuplicateEnt... | AzureTRE/api_app/tests_ma/test_api/test_routes/test_workspace_templates.py/0 | {
"file_path": "AzureTRE/api_app/tests_ma/test_api/test_routes/test_workspace_templates.py",
"repo_id": "AzureTRE",
"token_count": 5074
} | 95 |
from mock import patch
import pytest
import pytest_asyncio
from db.errors import EntityDoesNotExist
from db.repositories.resources import IS_NOT_DELETED_CLAUSE
from db.repositories.user_resources import UserResourceRepository
from models.domain.resource import ResourceType
from models.domain.user_resource import UserR... | AzureTRE/api_app/tests_ma/test_db/test_repositories/test_user_resource_repository.py/0 | {
"file_path": "AzureTRE/api_app/tests_ma/test_db/test_repositories/test_user_resource_repository.py",
"repo_id": "AzureTRE",
"token_count": 1684
} | 96 |
from unittest.mock import AsyncMock
from mock import patch
import pytest
from models.domain.costs import GranularityEnum
from models.domain.shared_service import SharedService, ResourceType
from models.domain.user_resource import UserResource
from models.domain.workspace import Workspace
from models.domain.workspace_se... | AzureTRE/api_app/tests_ma/test_services/test_cost_service.py/0 | {
"file_path": "AzureTRE/api_app/tests_ma/test_services/test_cost_service.py",
"repo_id": "AzureTRE",
"token_count": 19926
} | 97 |
#!/bin/bash
set -e
echo "Cleaning build/dist folders..."
rm -rf build
rm -rf dist
echo "Running build..."
pip install build
python -m build
echo "Done." | AzureTRE/cli/scripts/build.sh/0 | {
"file_path": "AzureTRE/cli/scripts/build.sh",
"repo_id": "AzureTRE",
"token_count": 53
} | 98 |
import json
import logging
import click
from tre.api_client import ApiClient
from tre.output import output, output_option, query_option
@click.group(name="shared-service-templates", help="List shared-service-templates ")
def shared_service_templates():
pass
@click.command(name="list", help="List shared-service... | AzureTRE/cli/tre/commands/shared_service_templates/shared_service_templates.py/0 | {
"file_path": "AzureTRE/cli/tre/commands/shared_service_templates/shared_service_templates.py",
"repo_id": "AzureTRE",
"token_count": 641
} | 99 |
import click
class WorkspaceTemplateContext(object):
def __init__(self, template_name: str):
self.template_name = template_name
pass_workspace_template_context = click.make_pass_decorator(WorkspaceTemplateContext)
| AzureTRE/cli/tre/commands/workspace_templates/contexts.py/0 | {
"file_path": "AzureTRE/cli/tre/commands/workspace_templates/contexts.py",
"repo_id": "AzureTRE",
"token_count": 73
} | 100 |
data "azurerm_container_registry" "mgmt_acr" {
name = var.mgmt_acr_name
resource_group_name = var.mgmt_resource_group_name
}
resource "azurerm_user_assigned_identity" "airlock_id" {
resource_group_name = var.resource_group_name
location = var.location
name = "id-airlo... | AzureTRE/core/terraform/airlock/identity.tf/0 | {
"file_path": "AzureTRE/core/terraform/airlock/identity.tf",
"repo_id": "AzureTRE",
"token_count": 1029
} | 101 |
variable "tre_id" {
type = string
}
variable "location" {
type = string
}
variable "resource_group_name" {
type = string
}
variable "app_gw_subnet" {
type = string
}
variable "shared_subnet" {
type = string
}
variable "api_fqdn" {
type = string
}
variable "keyvault_id" {
type = string
}
variable "static_... | AzureTRE/core/terraform/appgateway/variables.tf/0 | {
"file_path": "AzureTRE/core/terraform/appgateway/variables.tf",
"repo_id": "AzureTRE",
"token_count": 158
} | 102 |
resource "azurerm_key_vault" "kv" {
name = "kv-${var.tre_id}"
tenant_id = data.azurerm_client_config.current.tenant_id
location = azurerm_resource_group.core.location
resource_group_name = azurerm_resource_group.core.name
sku_name = "stan... | AzureTRE/core/terraform/keyvault.tf/0 | {
"file_path": "AzureTRE/core/terraform/keyvault.tf",
"repo_id": "AzureTRE",
"token_count": 2060
} | 103 |
locals {
version = replace(replace(replace(data.local_file.version.content, "__version__ = \"", ""), "\"", ""), "\n", "")
tre_core_tags = {
tre_id = var.tre_id
tre_core_service_id = var.tre_id
}
azure_environment = lookup({
"public" = "AzureCloud"
"usgovernment" = "AzureUSGov... | AzureTRE/core/terraform/resource_processor/vmss_porter/locals.tf/0 | {
"file_path": "AzureTRE/core/terraform/resource_processor/vmss_porter/locals.tf",
"repo_id": "AzureTRE",
"token_count": 157
} | 104 |
#!/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 a workspace TRE. You would typical... | AzureTRE/devops/scripts/aad/create_workspace_application.sh/0 | {
"file_path": "AzureTRE/devops/scripts/aad/create_workspace_application.sh",
"repo_id": "AzureTRE",
"token_count": 5706
} | 105 |
#!/bin/bash
set -euo pipefail
# Use this for debug only
# set -o xtrace
: "${AAD_TENANT_ID?'You have not set your aad_tenant_id in ./config.yaml'}"
# Get the directory that this script is in
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
CHANGED_TENANT=0
LOGGED_IN_TENANT_ID=$(az account show... | AzureTRE/devops/scripts/create_aad_assets.sh/0 | {
"file_path": "AzureTRE/devops/scripts/create_aad_assets.sh",
"repo_id": "AzureTRE",
"token_count": 1027
} | 106 |
#!/bin/bash
set -e
# By default the docker.sock file is not associated with docker group on codespaces or macOS
# which causes a permission issue when docker is run without sudo.
if ! docker ps > /dev/null 2>&1; then
echo "docker ps failed, setting docker.sock permissions"
sudo chgrp docker /var/run/docker.sock
... | AzureTRE/devops/scripts/set_docker_sock_permission.sh/0 | {
"file_path": "AzureTRE/devops/scripts/set_docker_sock_permission.sh",
"repo_id": "AzureTRE",
"token_count": 113
} | 107 |
# Azure TRE Architecture
The Azure Trusted Research Environment (TRE) consists of multiple components, all encapsulated in networks with restricted ingress- & egress traffic.
There is one network for the core components and one network per Workspace.
All traffic has to be explicitly allowed by the Application Gatewa... | AzureTRE/docs/azure-tre-overview/architecture.md/0 | {
"file_path": "AzureTRE/docs/azure-tre-overview/architecture.md",
"repo_id": "AzureTRE",
"token_count": 1842
} | 108 |
# The API Identity
## Name
The API Identity is typically called `<TRE_ID> API` within the Microsoft Entra ID Portal.
## Purpose
This identity's credentials are stored in the `core` Key Vault and mandatory for the running of the Trusted Research Environment (TRE). It is required for the API Application, hosted in Azur... | AzureTRE/docs/tre-admins/identities/api.md/0 | {
"file_path": "AzureTRE/docs/tre-admins/identities/api.md",
"repo_id": "AzureTRE",
"token_count": 1282
} | 109 |
# Pre-deployment steps
!!! info
See [Environment variables](../environment-variables.md) for full details of the deployment related variables.
## Set environment configuration variables of shared management resources
1. In this part we will setup configuration variables in `config.yaml` file for the shared manag... | AzureTRE/docs/tre-admins/setup-instructions/manual-pre-deployment-steps.md/0 | {
"file_path": "AzureTRE/docs/tre-admins/setup-instructions/manual-pre-deployment-steps.md",
"repo_id": "AzureTRE",
"token_count": 701
} | 110 |
# Letsencrypt
Certain components of the TRE require the aquisition of a certificate via Letsencrypt to ensure secure HTTPS connections.
In order to aquire these certificates, there must be a public facing endpoint which can be reached by Letsencrypt.
As TREs are secured environments with very few publicly facing poi... | AzureTRE/docs/tre-developers/letsencrypt.md/0 | {
"file_path": "AzureTRE/docs/tre-developers/letsencrypt.md",
"repo_id": "AzureTRE",
"token_count": 696
} | 111 |
# Azure Databricks workspace service bundle
See: [https://azure.microsoft.com/en-us/products/databricks/](https://azure.microsoft.com/en-us/products/databricks/)
This service along with Azure Databricks Private Authentication Shared Service installs the following resources into an existing virtual network within the ... | AzureTRE/docs/tre-templates/workspace-services/databricks.md/0 | {
"file_path": "AzureTRE/docs/tre-templates/workspace-services/databricks.md",
"repo_id": "AzureTRE",
"token_count": 498
} | 112 |
# Airlock Troubleshooting
## Users cannot create Review VMs
If a user sees an error when creating Review VMs, this most likely means that the configuration isn't correct.
Double-check that all GUIDs don't have any symbols missing, and the names of templates are correct.
["
},
"tre_url": {
"type": "String",
"value": "@appsetting('tre_url')"
}
}
| AzureTRE/templates/shared_services/airlock_notifier/app/parameters.json/0 | {
"file_path": "AzureTRE/templates/shared_services/airlock_notifier/app/parameters.json",
"repo_id": "AzureTRE",
"token_count": 84
} | 118 |
# syntax=docker/dockerfile-upstream:1.4.0
FROM --platform=linux/amd64 python:3.8-slim-bullseye
# 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=typ... | AzureTRE/templates/shared_services/certs/Dockerfile.tmpl/0 | {
"file_path": "AzureTRE/templates/shared_services/certs/Dockerfile.tmpl",
"repo_id": "AzureTRE",
"token_count": 378
} | 119 |
# GUID to identify the shared service
ID=
| AzureTRE/templates/shared_services/cyclecloud/.env.sample/0 | {
"file_path": "AzureTRE/templates/shared_services/cyclecloud/.env.sample",
"repo_id": "AzureTRE",
"token_count": 12
} | 120 |
{
"schemaType": "ParameterSet",
"schemaVersion": "1.0.1",
"namespace": "",
"name": "tre-shared-service-databricks-private-auth",
"parameters": [
{
"name": "id",
"source": {
"env": "ID"
}
},
{
"name": "tre_id",
"source": {
"env": "TRE_ID"
}
},... | AzureTRE/templates/shared_services/databricks-auth/parameters.json/0 | {
"file_path": "AzureTRE/templates/shared_services/databricks-auth/parameters.json",
"repo_id": "AzureTRE",
"token_count": 445
} | 121 |
---
schemaVersion: 1.0.0
name: tre-shared-service-firewall
version: 1.1.7
description: "An Azure TRE Firewall shared service"
dockerfile: Dockerfile.tmpl
registry: azuretre
credentials:
- name: azure_tenant_id
env: ARM_TENANT_ID
- name: azure_subscription_id
env: ARM_SUBSCRIPTION_ID
- name: azure_client_... | AzureTRE/templates/shared_services/firewall/porter.yaml/0 | {
"file_path": "AzureTRE/templates/shared_services/firewall/porter.yaml",
"repo_id": "AzureTRE",
"token_count": 1541
} | 122 |
{
"name": "microsoft-keys",
"online": true,
"storage": {
"blobStoreName": "default",
"strictContentTypeValidation": false,
"write_policy": "ALLOW"
},
"proxy": {
"remoteUrl": "https://packages.microsoft.com/keys/",
"contentMaxAge": 1440,
"metadataMaxAge": 1440
},
"negati... | AzureTRE/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/microsoft_keys_proxy_conf.json/0 | {
"file_path": "AzureTRE/templates/shared_services/sonatype-nexus-vm/scripts/nexus_repos_config/microsoft_keys_proxy_conf.json",
"repo_id": "AzureTRE",
"token_count": 339
} | 123 |
resource "azurerm_network_interface" "nexus" {
name = "nic-nexus-${var.tre_id}"
location = data.azurerm_resource_group.rg.location
resource_group_name = local.core_resource_group_name
tags = local.tre_shared_service_tags
ip_configuration {
name ... | AzureTRE/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf/0 | {
"file_path": "AzureTRE/templates/shared_services/sonatype-nexus-vm/terraform/vm.tf",
"repo_id": "AzureTRE",
"token_count": 3924
} | 124 |
output "azureml_workspace_name" {
value = azurerm_machine_learning_workspace.aml_workspace.name
}
output "azureml_acr_id" {
value = azurerm_container_registry.acr.id
}
output "azureml_storage_account_id" {
value = azurerm_storage_account.aml.id
}
output "aml_fqdn" {
value = regex("(?:(?P<scheme>[^:/?#]+):)?(... | AzureTRE/templates/workspace_services/azureml/terraform/outputs.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/azureml/terraform/outputs.tf",
"repo_id": "AzureTRE",
"token_count": 663
} | 125 |
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.37.0"
}
azapi = {
source = "Azure/azapi"
version = "=1.1.0"
}
}
backend "azurerm" {}
}
provider "azurerm" {
features {
}
}
provider "azapi" {}
| AzureTRE/templates/workspace_services/azureml/user_resources/aml_compute/terraform/providers.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/azureml/user_resources/aml_compute/terraform/providers.tf",
"repo_id": "AzureTRE",
"token_count": 147
} | 126 |
output "databricks_workspace_name" {
value = azurerm_databricks_workspace.databricks.name
}
output "connection_uri" {
value = "https://${azurerm_databricks_workspace.databricks.workspace_url}/aad/auth?has=&Workspace=${data.azurerm_subscription.current.id}/resourceGroups/${local.resource_group_name}/providers/Micro... | AzureTRE/templates/workspace_services/databricks/terraform/outputs.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/databricks/terraform/outputs.tf",
"repo_id": "AzureTRE",
"token_count": 799
} | 127 |
#!/bin/bash
# 1. Remove any previously run failed flag
# 2. Run maven, but capture the exit code so we always succeed
# 3. Output a file if the tests are not successful.
rm -f /target/surefire-reports/guacamole_package_failed
pytest_result=$(mvn package)
if [ $? != 0 ]; then
touch /target/surefire-reports/guacamole... | AzureTRE/templates/workspace_services/guacamole/guacamole-server/docker/maven_package_and_exit_succesfully.sh/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/guacamole-server/docker/maven_package_and_exit_succesfully.sh",
"repo_id": "AzureTRE",
"token_count": 111
} | 128 |
/*
* 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 License, Version 2.0 (the
* "License"); you ... | AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/src/main/java/org/apache/guacamole/auth/azuretre/connection/ConnectionService.java/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/src/main/java/org/apache/guacamole/auth/azuretre/connection/ConnectionService.java",
"repo_id": "AzureTRE",
"token_count": 2866
} | 129 |
/**
*
*/
package org.apache.guacamole.auth.azuretre.user;
| AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/src/test/java/org/apache/guacamole/auth/azuretre/user/package-info.java/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/guacamole-server/guacamole-auth-azure/src/test/java/org/apache/guacamole/auth/azuretre/user/package-info.java",
"repo_id": "AzureTRE",
"token_count": 25
} | 130 |
# GUID to identify the workspace
WORKSPACE_ID=__CHANGE_ME__
# Unique identifier of the parent Guacamole service
PARENT_SERVICE_ID=__CHANGE_ME__
| AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-import-reviewvm/.env.sample/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-import-reviewvm/.env.sample",
"repo_id": "AzureTRE",
"token_count": 49
} | 131 |
# Azure Provider source and version being used
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=3.41.0"
}
template = {
source = "hashicorp/template"
version = "=2.2.0"
}
random = {
source = "hashicorp/random"
version = "=3... | AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/terraform/main.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/guacamole/user_resources/guacamole-azure-linuxvm/terraform/main.tf",
"repo_id": "AzureTRE",
"token_count": 940
} | 132 |
output "healthcare_workspace_id" {
value = azurerm_healthcare_workspace.healthcare_workspace.id
}
output "fhir_url" {
value = var.deploy_fhir ? "https://hs${local.service_resource_name_suffix}-fhir${local.service_resource_name_suffix}.fhir.azurehealthcareapis.com" : ""
}
output "dicom_url" {
value = var.deploy_... | AzureTRE/templates/workspace_services/health-services/terraform/outputs.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/health-services/terraform/outputs.tf",
"repo_id": "AzureTRE",
"token_count": 219
} | 133 |
data "azurerm_firewall" "fw" {
name = "fw-${var.tre_id}"
resource_group_name = "rg-${var.tre_id}"
}
locals {
allowedInnerEyeURLs = ["*.anaconda.com", "*.anaconda.org", "binstar-cio-packages-prod.s3.amazonaws.com", "*pythonhosted.org", "github-cloud.githubusercontent.com", "azure.archive.ubuntu.com... | AzureTRE/templates/workspace_services/innereye/terraform/firewall.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/innereye/terraform/firewall.tf",
"repo_id": "AzureTRE",
"token_count": 845
} | 134 |
---
schemaVersion: 1.0.0
name: tre-workspace-service-ohdsi
version: 0.2.4
description: "An OHDSI workspace service"
registry: azuretre
dockerfile: Dockerfile.tmpl
custom:
dialects:
"Azure Synapse": "synapse"
credentials:
- name: azure_tenant_id
env: ARM_TENANT_ID
- name: azure_subscription_id
env: A... | AzureTRE/templates/workspace_services/ohdsi/porter.yaml/0 | {
"file_path": "AzureTRE/templates/workspace_services/ohdsi/porter.yaml",
"repo_id": "AzureTRE",
"token_count": 2600
} | 135 |
resource "azurerm_storage_share" "atlas_ui" {
name = local.atlas_ui_storage_share_name
storage_account_name = data.azurerm_storage_account.stg.name
quota = 1
}
resource "local_file" "config_local" {
content = templatefile("${path.module}/config_local.tftpl", { OHDSI_WEBAPI_URL =... | AzureTRE/templates/workspace_services/ohdsi/terraform/atlas_ui.tf/0 | {
"file_path": "AzureTRE/templates/workspace_services/ohdsi/terraform/atlas_ui.tf",
"repo_id": "AzureTRE",
"token_count": 1593
} | 136 |
# System topics
# Below we assign a SYSTEM-assigned identity for the topics. note that a user-assigned identity will not work.
resource "azurerm_eventgrid_system_topic" "import_approved_blob_created" {
name = local.import_approved_sys_topic_name
location = var.location
resource_g... | AzureTRE/templates/workspaces/base/terraform/airlock/eventgrid_topics.tf/0 | {
"file_path": "AzureTRE/templates/workspaces/base/terraform/airlock/eventgrid_topics.tf",
"repo_id": "AzureTRE",
"token_count": 2519
} | 137 |
data "azurerm_virtual_network" "core" {
name = local.core_vnet
resource_group_name = local.core_resource_group_name
}
data "azurerm_subnet" "core_webapps" {
name = "WebAppSubnet"
virtual_network_name = "vnet-${var.tre_id}"
resource_group_name = "rg-${var.tre_id}"
}
data "azur... | AzureTRE/templates/workspaces/base/terraform/network/data.tf/0 | {
"file_path": "AzureTRE/templates/workspaces/base/terraform/network/data.tf",
"repo_id": "AzureTRE",
"token_count": 1929
} | 138 |
import React from 'react';
import { render, screen } from '@testing-library/react';
import { App } from './App';
it('renders "Welcome to Your Fluent UI App"', () => {
render(<App />);
const linkElement = screen.getByText(/Welcome to Your Fluent UI App/i);
expect(linkElement).toBeInTheDocument();
});
| AzureTRE/ui/app/src/App.test.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/App.test.tsx",
"repo_id": "AzureTRE",
"token_count": 98
} | 139 |
import { MessageBar, MessageBarType } from "@fluentui/react";
import React from "react";
interface ErrorState {
hasError: boolean
}
export class GenericErrorBoundary extends React.Component<any, ErrorState, any> {
constructor(props: any) {
super(props);
this.state = { hasError: false };
}
static getD... | AzureTRE/ui/app/src/components/shared/GenericErrorBoundary.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/shared/GenericErrorBoundary.tsx",
"repo_id": "AzureTRE",
"token_count": 403
} | 140 |
import React, { useContext, useEffect, useState } from 'react';
import { Resource } from '../../models/resource';
import { ResourceCardList } from '../shared/ResourceCardList';
import { PrimaryButton, Stack } from '@fluentui/react';
import { ResourceType } from '../../models/resourceType';
import { SharedService } from... | AzureTRE/ui/app/src/components/shared/SharedServices.tsx/0 | {
"file_path": "AzureTRE/ui/app/src/components/shared/SharedServices.tsx",
"repo_id": "AzureTRE",
"token_count": 1168
} | 141 |
{
"id": "ba02d504-47d5-412d-b192-b75d17c65009",
"resourceId": "8b6e42a0-e236-46ae-9541-01b462e4b468",
"resourcePath": "/workspaces/1e800001-7385-46a1-9f6d-490a6201ea01/workspace-services/8c70974a-5f66-4ae9-9502-7a54e9e0bb86/user-resources/8b6e42a0-e236-46ae-9541-01b462e4b468",
"resourceVersion": 0,
... | AzureTRE/ui/app/src/components/shared/notifications/dummyOpSteps.json/0 | {
"file_path": "AzureTRE/ui/app/src/components/shared/notifications/dummyOpSteps.json",
"repo_id": "AzureTRE",
"token_count": 1271
} | 142 |
import { AuthenticationResult, InteractionRequiredAuthError } from "@azure/msal-browser";
import { useMsal, useAccount } from "@azure/msal-react";
import { useCallback } from "react";
import { APIError } from "../models/exceptions";
import config from "../config.json";
export enum ResultType {
JSON = "JSON",
Text ... | AzureTRE/ui/app/src/hooks/useAuthApiCall.ts/0 | {
"file_path": "AzureTRE/ui/app/src/hooks/useAuthApiCall.ts",
"repo_id": "AzureTRE",
"token_count": 1700
} | 143 |
import { Resource } from "./resource";
export interface UserResource extends Resource {
parentWorkspaceServiceId: string
} | AzureTRE/ui/app/src/models/userResource.ts/0 | {
"file_path": "AzureTRE/ui/app/src/models/userResource.ts",
"repo_id": "AzureTRE",
"token_count": 31
} | 144 |
t i 278188134
t h 243253041
i n 219900666
a n 217691322
r e 210476714
e n 172652038
e r 165613587
e d</w> 144413979
o f</w> 136414062
th e</w> 133581460
o n 130270978
o n</w> 124545307
r o 115272062
an d</w> 107616579
a ti 106435235
i n</w> 105361810
a t 104514969
i t 95710914
a l</w> 94809696
a r 93308588
o r 89914619... | BioGPT/data/bpecodes/0 | {
"file_path": "BioGPT/data/bpecodes",
"repo_id": "BioGPT",
"token_count": 332329
} | 145 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import sys
import re
import json
data_dir=sys.argv[1]
prefix=sys.argv[2]
def build_source_seq(question, context, long_answer=None):
if long_answer:
src = "question: {} context: {} answer: {}".format(question.strip(), cont... | BioGPT/examples/QA-PubMedQA/rebuild_data.py/0 | {
"file_path": "BioGPT/examples/QA-PubMedQA/rebuild_data.py",
"repo_id": "BioGPT",
"token_count": 1071
} | 146 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from bitblas.utils.target_detector import auto_detect_nvidia_target
from bitblas import Matmul, MatmulConfig
import argparse
# Initialize the parser
parser = argparse.ArgumentParser(
description="Benchmark BitBLAS int4 on a specific t... | BitBLAS/benchmark/operators/benchmark_bitblas_matmul.py/0 | {
"file_path": "BitBLAS/benchmark/operators/benchmark_bitblas_matmul.py",
"repo_id": "BitBLAS",
"token_count": 3838
} | 147 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import argparse
import torch
from modeling_bitnet import BitnetForCausalLM
torch.set_grad_enabled(False)
parser = argparse.ArgumentParser()
parser.add_argument("--hf_path", default="1bitLLM/bitnet_b1_58-3B", type=str)
parser.add_argument("--ba... | BitBLAS/integration/BitNet/benchmark_model_10k_loops.py/0 | {
"file_path": "BitBLAS/integration/BitNet/benchmark_model_10k_loops.py",
"repo_id": "BitBLAS",
"token_count": 698
} | 148 |
#!/bin/bash
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# if dist and build directories exist, remove them
if [ -d dist ]; then
rm -r dist
fi
if [ -d build ]; then
rm -r build
fi
python setup.py bdist_wheel
| BitBLAS/maint/scripts/local_distribution.sh/0 | {
"file_path": "BitBLAS/maint/scripts/local_distribution.sh",
"repo_id": "BitBLAS",
"token_count": 83
} | 149 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""PrimFunc Wrapper and Block information Analaysis"""
import tvm
from tvm import tir
from tvm.tir import IterVar, PrimFunc
from typing import Any, Dict, List, Tuple, Optional
from tvm.tir.schedule.schedule import BlockRV
import numpy as np
impor... | BitBLAS/python/bitblas/base/roller/node.py/0 | {
"file_path": "BitBLAS/python/bitblas/base/roller/node.py",
"repo_id": "BitBLAS",
"token_count": 7738
} | 150 |
# Copyright 2018 The apache/tvm Authors. All Rights Reserved.
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under th... | BitBLAS/python/bitblas/gpu/base.py/0 | {
"file_path": "BitBLAS/python/bitblas/gpu/base.py",
"repo_id": "BitBLAS",
"token_count": 498
} | 151 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# pylint: disable=missing-docstring
"""Utility methods for generic GPU."""
from typing import List, Optional
from tvm import tir
from tvm.target import Target
def max_threads_per_block(target: Target) -> int:
"""Get the maximum number of t... | BitBLAS/python/bitblas/gpu/utils.py/0 | {
"file_path": "BitBLAS/python/bitblas/gpu/utils.py",
"repo_id": "BitBLAS",
"token_count": 991
} | 152 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from tvm.target import Target
from typing import Literal, Union
from .operator import Operator, TransformKind
from .impl.param_permutate_impl import select_implementation
from dataclasses import dataclass
@dataclass(frozen=True)
class ParamPermu... | BitBLAS/python/bitblas/ops/param_permutate.py/0 | {
"file_path": "BitBLAS/python/bitblas/ops/param_permutate.py",
"repo_id": "BitBLAS",
"token_count": 1099
} | 153 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import pytest
import bitblas
from bitblas.utils import auto_detect_nvidia_target
from bitblas.ops.matmul_dequantize import (
MatmulWeightOnlyDequantize,
MatmulWeightOnlyDequantizeConfig,
)
import tvm
import logging
from bitblas import set_... | BitBLAS/testing/python/operators/test_matmul_dequantize_ops.py/0 | {
"file_path": "BitBLAS/testing/python/operators/test_matmul_dequantize_ops.py",
"repo_id": "BitBLAS",
"token_count": 13779
} | 154 |
from ..datasets import VQAv2Dataset
from .datamodule_base import BaseDataModule
from collections import defaultdict
class VQAv2DataModule(BaseDataModule):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
@property
def dataset_cls(self):
return VQAv2Dataset
@prop... | BridgeTower/src/datamodules/vqav2_datamodule.py/0 | {
"file_path": "BridgeTower/src/datamodules/vqav2_datamodule.py",
"repo_id": "BridgeTower",
"token_count": 634
} | 155 |
from collections import OrderedDict
from typing import Tuple, Union
import numpy as np
import torch
import torch.nn.functional as F
from torch import nn
class LayerNorm(nn.LayerNorm):
"""Subclass torch's LayerNorm to handle fp16."""
def forward(self, x: torch.Tensor):
orig_type = x.dtype
ret... | BridgeTower/src/modules/clip_model.py/0 | {
"file_path": "BridgeTower/src/modules/clip_model.py",
"repo_id": "BridgeTower",
"token_count": 6470
} | 156 |
# Based on https://github.com/peteanderson80/bottom-up-attention/blob/master/data/genome/create_splits.py
''' Determine visual genome data splits to avoid contamination of COCO splits.'''
import argparse
import os
import random
from random import shuffle
import shutil
import subprocess
import sys
import json
random.s... | BridgeTower/src/utils/vgqa_split.py/0 | {
"file_path": "BridgeTower/src/utils/vgqa_split.py",
"repo_id": "BridgeTower",
"token_count": 1484
} | 157 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from data.base_dataset import BaseDataset, get_params, get_transform
from PIL import Image
import util.util as util
import os
class Pix2pixDataset(BaseDataset):
@staticmethod
def modify_commandline_options(parser, is_train):
par... | Bringing-Old-Photos-Back-to-Life/Face_Enhancement/data/pix2pix_dataset.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/Face_Enhancement/data/pix2pix_dataset.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 1742
} | 158 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import re
import importlib
import torch
from argparse import Namespace
import numpy as np
from PIL import Image
import os
import argparse
import dill as pickle
def save_obj(obj, name):
with open(name, "wb") as f:
pickle.dump(obj, f,... | Bringing-Old-Photos-Back-to-Life/Face_Enhancement/util/util.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/Face_Enhancement/util/util.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 2895
} | 159 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import os
import sys
import time
import shutil
import platform
import numpy as np
from datetime import datetime
import torch
import torchvision as tv
import torch.backends.cudnn as cudnn
# from torch.utils.tensorboard import SummaryWriter
impo... | Bringing-Old-Photos-Back-to-Life/Global/detection_util/util.py/0 | {
"file_path": "Bringing-Old-Photos-Back-to-Life/Global/detection_util/util.py",
"repo_id": "Bringing-Old-Photos-Back-to-Life",
"token_count": 3479
} | 160 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.