text stringlengths 96 319k | id stringlengths 14 178 | metadata dict |
|---|---|---|
import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';
import { Tensor } from '../../utils/tensor.js';
import { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';
export class ClapFeatureExtractor extends FeatureExtractor {
constructor(config) ... | transformers.js/src/models/clap/feature_extraction_clap.js/0 | {
"file_path": "transformers.js/src/models/clap/feature_extraction_clap.js",
"repo_id": "transformers.js",
"token_count": 3003
} |
import {
ImageProcessor,
} from "../../base/image_processors_utils.js";
export class VLMImageProcessor extends ImageProcessor {
constructor(config) {
super({
do_pad: true,
pad_size: {
width: config.image_size,
height: config.image_size,
... | transformers.js/src/models/janus/image_processing_janus.js/0 | {
"file_path": "transformers.js/src/models/janus/image_processing_janus.js",
"repo_id": "transformers.js",
"token_count": 359
} |
import { FeatureExtractor, validate_audio_inputs } from '../../base/feature_extraction_utils.js';
import { Tensor } from '../../utils/tensor.js';
import { mel_filter_bank, spectrogram, window_function } from '../../utils/audio.js';
export class SeamlessM4TFeatureExtractor extends FeatureExtractor {
constructor(co... | transformers.js/src/models/seamless_m4t/feature_extraction_seamless_m4t.js/0 | {
"file_path": "transformers.js/src/models/seamless_m4t/feature_extraction_seamless_m4t.js",
"repo_id": "transformers.js",
"token_count": 3364
} |
/**
* @file Helper module for `Tensor` processing.
*
* These functions and classes are only used internally,
* meaning an end-user shouldn't need to access anything here.
*
* @module utils/tensor
*/
import {
interpolate_data,
max,
min,
permute_data
} from './maths.js';
import {
Tensor as ON... | transformers.js/src/utils/tensor.js/0 | {
"file_path": "transformers.js/src/utils/tensor.js",
"repo_id": "transformers.js",
"token_count": 21491
} |
import { FalconTokenizer } from "../../../src/tokenizers.js";
import { BASE_TEST_STRINGS, FALCON_TEST_STRINGS } from "../test_strings.js";
export const TOKENIZER_CLASS = FalconTokenizer;
export const TEST_CONFIG = {
"tiiuae/falcon-7b": {
SIMPLE: {
text: BASE_TEST_STRINGS.SIMPLE,
tokens: ["How", "\u01... | transformers.js/tests/models/falcon/test_tokenization_falcon.js/0 | {
"file_path": "transformers.js/tests/models/falcon/test_tokenization_falcon.js",
"repo_id": "transformers.js",
"token_count": 6152
} |
import { AutoProcessor, full, GroundingDinoProcessor } from "../../../src/transformers.js";
import { load_cached_image } from "../../asset_cache.js";
import { MAX_PROCESSOR_LOAD_TIME, MAX_TEST_EXECUTION_TIME } from "../../init.js";
export default () => {
const model_id = "hf-internal-testing/tiny-random-GroundingDi... | transformers.js/tests/models/grounding_dino/test_processor_grounding_dino.js/0 | {
"file_path": "transformers.js/tests/models/grounding_dino/test_processor_grounding_dino.js",
"repo_id": "transformers.js",
"token_count": 821
} |
import { AutoImageProcessor, Phi3VImageProcessor } from "../../../src/transformers.js";
import { load_cached_image } from "../../asset_cache.js";
import { MAX_PROCESSOR_LOAD_TIME, MAX_TEST_EXECUTION_TIME } from "../../init.js";
const TARGET_IMAGE_SIZE = [3, 336, 336];
export default () => {
// Phi3VImageProcessor
... | transformers.js/tests/models/phi3_v/test_image_processing_phi3_v.js/0 | {
"file_path": "transformers.js/tests/models/phi3_v/test_image_processing_phi3_v.js",
"repo_id": "transformers.js",
"token_count": 1634
} |
import { AutoImageProcessor, ViTFeatureExtractor } from "../../../src/transformers.js";
import { load_cached_image } from "../../asset_cache.js";
import { MAX_PROCESSOR_LOAD_TIME, MAX_TEST_EXECUTION_TIME } from "../../init.js";
export default () => {
describe("ViTFeatureExtractor", () => {
const model_id = "Xen... | transformers.js/tests/models/vit/test_image_processing_vit.js/0 | {
"file_path": "transformers.js/tests/models/vit/test_image_processing_vit.js",
"repo_id": "transformers.js",
"token_count": 435
} |
import { pipeline, FeatureExtractionPipeline } from "../../src/transformers.js";
import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../init.js";
const PIPELINE_ID = "feature-extraction";
export default () => {
describe("Feature Extraction", () => {
cons... | transformers.js/tests/pipelines/test_pipelines_feature_extraction.js/0 | {
"file_path": "transformers.js/tests/pipelines/test_pipelines_feature_extraction.js",
"repo_id": "transformers.js",
"token_count": 2082
} |
import { pipeline, ZeroShotClassificationPipeline } from "../../src/transformers.js";
import { MAX_MODEL_LOAD_TIME, MAX_TEST_EXECUTION_TIME, MAX_MODEL_DISPOSE_TIME, DEFAULT_MODEL_OPTIONS } from "../init.js";
const PIPELINE_ID = "zero-shot-classification";
export default () => {
describe("Zero-shot Classification",... | transformers.js/tests/pipelines/test_pipelines_zero_shot.js/0 | {
"file_path": "transformers.js/tests/pipelines/test_pipelines_zero_shot.js",
"repo_id": "transformers.js",
"token_count": 1523
} |
{
// Only include files in the src directory
"include": ["src/**/*"],
"compilerOptions": {
// Tells the compiler to check JS files
"checkJs": true,
"target": "esnext",
"module": "nodenext",
"moduleResolution": "nodenext",
"outDir": "types",
"strict": false,
"skipLibCheck": true,
... | transformers.js/tsconfig.json/0 | {
"file_path": "transformers.js/tsconfig.json",
"repo_id": "transformers.js",
"token_count": 196
} |
apiVersion: 1
providers:
- name: 'Transformers Benchmarks'
orgId: 1
type: file
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /etc/grafana/dashboards
| transformers/benchmark/default.yml/0 | {
"file_path": "transformers/benchmark/default.yml",
"repo_id": "transformers",
"token_count": 81
} |
FROM python:3.9-slim
ENV PYTHONDONTWRITEBYTECODE=1
ARG REF=main
USER root
RUN apt-get update && apt-get install -y --no-install-recommends libsndfile1-dev espeak-ng time git pkg-config openssh-client git
ENV UV_PYTHON=/usr/local/bin/python
RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -... | transformers/docker/pipeline-torch.dockerfile/0 | {
"file_path": "transformers/docker/pipeline-torch.dockerfile",
"repo_id": "transformers",
"token_count": 275
} |
local base = import 'templates/base.libsonnet';
local tpus = import 'templates/tpus.libsonnet';
local utils = import "templates/utils.libsonnet";
local volumes = import "templates/volumes.libsonnet";
local bertBaseCased = base.BaseTest {
frameworkPrefix: "hf",
modelName: "bert-base-cased",
mode: "example",
con... | transformers/docker/transformers-pytorch-tpu/bert-base-cased.jsonnet/0 | {
"file_path": "transformers/docker/transformers-pytorch-tpu/bert-base-cased.jsonnet",
"repo_id": "transformers",
"token_count": 371
} |
# ุงููู
ุงุฐุฌ ู
ุชุนุฏุฏุฉ ุงููุบุงุช ููุงุณุชุฏูุงู
ููุงู ุงูุนุฏูุฏ ู
ู ุงููู
ุงุฐุฌ ู
ุชุนุฏุฏุฉ ุงููุบุงุช ูู ู
ูุชุจุฉ ๐ค Transformersุ ูุชุฎุชูู ุทุฑููุฉ ุงุณุชุฎุฏุงู
ูุง ููุงุณุชุฏูุงู ุนู ุงููู
ุงุฐุฌ ุฃุญุงุฏูุฉ ุงููุบุฉ. ูููู ููุณ ูู ุงุณุชุฎุฏุงู
ุงููู
ุงุฐุฌ ู
ุชุนุฏุฏุฉ ุงููุบุงุช ู
ุฎุชูู. ูุจุนุถ ุงููู
ุงุฐุฌุ ู
ุซู [google-bert/bert-base-multilingual-uncased](https://huggingface.co/google-bert/bert-base-multili... | transformers/docs/source/ar/multilingual.md/0 | {
"file_path": "transformers/docs/source/ar/multilingual.md",
"repo_id": "transformers",
"token_count": 4876
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/ar/tasks/multiple_choice.md/0 | {
"file_path": "transformers/docs/source/ar/tasks/multiple_choice.md",
"repo_id": "transformers",
"token_count": 8570
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/de/accelerate.md/0 | {
"file_path": "transformers/docs/source/de/accelerate.md",
"repo_id": "transformers",
"token_count": 1929
} |
<!---
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 applicable law or ... | transformers/docs/source/en/contributing.md/0 | {
"file_path": "transformers/docs/source/en/contributing.md",
"repo_id": "transformers",
"token_count": 5208
} |
<!--Copyright 2021 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 applicable law or agreed... | transformers/docs/source/en/internal/file_utils.md/0 | {
"file_path": "transformers/docs/source/en/internal/file_utils.md",
"repo_id": "transformers",
"token_count": 412
} |
<!--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 applicable law or agreed... | transformers/docs/source/en/main_classes/data_collator.md/0 | {
"file_path": "transformers/docs/source/en/main_classes/data_collator.md",
"repo_id": "transformers",
"token_count": 712
} |
<!--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 applicable law or agreed... | transformers/docs/source/en/main_classes/trainer.md/0 | {
"file_path": "transformers/docs/source/en/main_classes/trainer.md",
"repo_id": "transformers",
"token_count": 689
} |
<!--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 applicable law or agreed... | transformers/docs/source/en/model_doc/bert.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/bert.md",
"repo_id": "transformers",
"token_count": 6475
} |
<!--Copyright 2021 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 applicable law or agreed... | transformers/docs/source/en/model_doc/canine.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/canine.md",
"repo_id": "transformers",
"token_count": 1723
} |
<!--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 applicable law or agreed... | transformers/docs/source/en/model_doc/cpm.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/cpm.md",
"repo_id": "transformers",
"token_count": 735
} |
<!--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 applicable law or agreed... | transformers/docs/source/en/model_doc/funnel.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/funnel.md",
"repo_id": "transformers",
"token_count": 1879
} |
<!--Copyright 2024 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 applicable law or agreed... | transformers/docs/source/en/model_doc/granite.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/granite.md",
"repo_id": "transformers",
"token_count": 1080
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/en/model_doc/nezha.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/nezha.md",
"repo_id": "transformers",
"token_count": 996
} |
<!--Copyright 2023 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 applicable law or agreed... | transformers/docs/source/en/model_doc/pvt.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/pvt.md",
"repo_id": "transformers",
"token_count": 1047
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/en/model_doc/roberta-prelayernorm.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/roberta-prelayernorm.md",
"repo_id": "transformers",
"token_count": 1519
} |
<!--Copyright 2021 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 applicable law or agreed... | transformers/docs/source/en/model_doc/speech_to_text.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/speech_to_text.md",
"repo_id": "transformers",
"token_count": 1920
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/en/model_doc/table-transformer.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/table-transformer.md",
"repo_id": "transformers",
"token_count": 978
} |
<!--Copyright 2021 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 applicable law or agreed... | transformers/docs/source/en/model_doc/unispeech.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/unispeech.md",
"repo_id": "transformers",
"token_count": 853
} |
<!--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 applicable law or agreed... | transformers/docs/source/en/model_doc/xlm.md/0 | {
"file_path": "transformers/docs/source/en/model_doc/xlm.md",
"repo_id": "transformers",
"token_count": 1744
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/en/pipeline_tutorial.md/0 | {
"file_path": "transformers/docs/source/en/pipeline_tutorial.md",
"repo_id": "transformers",
"token_count": 5090
} |
<!--Copyright 2024 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 applicable law or agreed... | transformers/docs/source/en/tasks/image_text_to_text.md/0 | {
"file_path": "transformers/docs/source/en/tasks/image_text_to_text.md",
"repo_id": "transformers",
"token_count": 3285
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/en/tasks/token_classification.md/0 | {
"file_path": "transformers/docs/source/en/tasks/token_classification.md",
"repo_id": "transformers",
"token_count": 6507
} |
<!---
Copyright 2022 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 applicable law or ... | transformers/docs/source/en/troubleshooting.md/0 | {
"file_path": "transformers/docs/source/en/troubleshooting.md",
"repo_id": "transformers",
"token_count": 2569
} |
<!--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 applicable law or agreed... | transformers/docs/source/es/serialization.md/0 | {
"file_path": "transformers/docs/source/es/serialization.md",
"repo_id": "transformers",
"token_count": 10517
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/fr/autoclass_tutorial.md/0 | {
"file_path": "transformers/docs/source/fr/autoclass_tutorial.md",
"repo_id": "transformers",
"token_count": 3454
} |
<!--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 applicable law or agreed... | transformers/docs/source/it/add_new_model.md/0 | {
"file_path": "transformers/docs/source/it/add_new_model.md",
"repo_id": "transformers",
"token_count": 17225
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/it/perf_infer_gpu_many.md/0 | {
"file_path": "transformers/docs/source/it/perf_infer_gpu_many.md",
"repo_id": "transformers",
"token_count": 420
} |
<!--
Copyright 2023 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 applicable law or agree... | transformers/docs/source/ja/add_new_model.md/0 | {
"file_path": "transformers/docs/source/ja/add_new_model.md",
"repo_id": "transformers",
"token_count": 27745
} |
<!--Copyright 2023 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 applicable law or agreed... | transformers/docs/source/ja/internal/audio_utils.md/0 | {
"file_path": "transformers/docs/source/ja/internal/audio_utils.md",
"repo_id": "transformers",
"token_count": 554
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/ja/model_doc/audio-spectrogram-transformer.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/audio-spectrogram-transformer.md",
"repo_id": "transformers",
"token_count": 2249
} |
<!--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 applicable law or agreed... | transformers/docs/source/ja/model_doc/blenderbot-small.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/blenderbot-small.md",
"repo_id": "transformers",
"token_count": 1831
} |
<!--Copyright 2023 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 applicable law or agreed... | transformers/docs/source/ja/model_doc/code_llama.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/code_llama.md",
"repo_id": "transformers",
"token_count": 4114
} |
<!--Copyright 2021 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 applicable law or agreed... | transformers/docs/source/ja/model_doc/deplot.md/0 | {
"file_path": "transformers/docs/source/ja/model_doc/deplot.md",
"repo_id": "transformers",
"token_count": 2027
} |
<!--Copyright 2023 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 applicable law or agreed... | transformers/docs/source/ja/perf_torch_compile.md/0 | {
"file_path": "transformers/docs/source/ja/perf_torch_compile.md",
"repo_id": "transformers",
"token_count": 6636
} |
<!--Copyright 2023 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 applicable law or agreed... | transformers/docs/source/ja/run_scripts.md/0 | {
"file_path": "transformers/docs/source/ja/run_scripts.md",
"repo_id": "transformers",
"token_count": 8250
} |
<!--Copyright 2023 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 applicable law or agreed... | transformers/docs/source/ja/tasks/prompting.md/0 | {
"file_path": "transformers/docs/source/ja/tasks/prompting.md",
"repo_id": "transformers",
"token_count": 9975
} |
<!---
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 applicable law or ... | transformers/docs/source/ko/contributing.md/0 | {
"file_path": "transformers/docs/source/ko/contributing.md",
"repo_id": "transformers",
"token_count": 15765
} |
<!--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 applicable law or agreed... | transformers/docs/source/ko/internal/generation_utils.md/0 | {
"file_path": "transformers/docs/source/ko/internal/generation_utils.md",
"repo_id": "transformers",
"token_count": 4837
} |
<!--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 applicable law or agreed... | transformers/docs/source/ko/model_doc/bertweet.md/0 | {
"file_path": "transformers/docs/source/ko/model_doc/bertweet.md",
"repo_id": "transformers",
"token_count": 1434
} |
<!--Copyright 2022 The HuggingFace Team and Microsoft. All rights reserved.
Licensed under the MIT License; you may not use this file except in compliance with
the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BASIS, WITHOUT WAR... | transformers/docs/source/ko/model_doc/graphormer.md/0 | {
"file_path": "transformers/docs/source/ko/model_doc/graphormer.md",
"repo_id": "transformers",
"token_count": 2817
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/ko/model_doc/swinv2.md/0 | {
"file_path": "transformers/docs/source/ko/model_doc/swinv2.md",
"repo_id": "transformers",
"token_count": 2648
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/ko/perf_infer_gpu_one.md/0 | {
"file_path": "transformers/docs/source/ko/perf_infer_gpu_one.md",
"repo_id": "transformers",
"token_count": 6517
} |
<!--Copyright 2024 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 applicable law or agreed... | transformers/docs/source/ko/quantization/gptq.md/0 | {
"file_path": "transformers/docs/source/ko/quantization/gptq.md",
"repo_id": "transformers",
"token_count": 4640
} |
<!--Copyright 2023 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 applicable law or agreed... | transformers/docs/source/ko/tasks/language_modeling.md/0 | {
"file_path": "transformers/docs/source/ko/tasks/language_modeling.md",
"repo_id": "transformers",
"token_count": 10486
} |
<!--Copyright 2023 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 applicable law or agreed... | transformers/docs/source/ko/tasks/zero_shot_object_detection.md/0 | {
"file_path": "transformers/docs/source/ko/tasks/zero_shot_object_detection.md",
"repo_id": "transformers",
"token_count": 7704
} |
<!--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 applicable law or agreed... | transformers/docs/source/pt/converting_tensorflow_models.md/0 | {
"file_path": "transformers/docs/source/pt/converting_tensorflow_models.md",
"repo_id": "transformers",
"token_count": 2440
} |
<!--Copyright 2022 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 applicable law or agreed... | transformers/docs/source/te/quicktour.md/0 | {
"file_path": "transformers/docs/source/te/quicktour.md",
"repo_id": "transformers",
"token_count": 37563
} |
<!--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 applicable law or agreed... | transformers/docs/source/zh/custom_models.md/0 | {
"file_path": "transformers/docs/source/zh/custom_models.md",
"repo_id": "transformers",
"token_count": 7977
} |
<!--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 applicable law or agreed... | transformers/docs/source/zh/main_classes/processors.md/0 | {
"file_path": "transformers/docs/source/zh/main_classes/processors.md",
"repo_id": "transformers",
"token_count": 3054
} |
<!--Copyright 2023 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 applicable law or agreed... | transformers/docs/source/zh/preprocessing.md/0 | {
"file_path": "transformers/docs/source/zh/preprocessing.md",
"repo_id": "transformers",
"token_count": 12751
} |
# Image Captioning (vision-encoder-text-decoder model) training example
The following example showcases how to finetune a vision-encoder-text-decoder model for image captioning
using the JAX/Flax backend, leveraging ๐ค Transformers library's [FlaxVisionEncoderDecoderModel](https://huggingface.co/docs/transformers/mode... | transformers/examples/flax/image-captioning/README.md/0 | {
"file_path": "transformers/examples/flax/image-captioning/README.md",
"repo_id": "transformers",
"token_count": 1084
} |
<!---
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 applicable law or ... | transformers/examples/legacy/benchmarking/README.md/0 | {
"file_path": "transformers/examples/legacy/benchmarking/README.md",
"repo_id": "transformers",
"token_count": 499
} |
#!/usr/bin/env python
import torch
from transformers import CamembertForMaskedLM, CamembertTokenizer
def fill_mask(masked_input, model, tokenizer, topk=5):
# Adapted from https://github.com/pytorch/fairseq/blob/master/fairseq/models/roberta/hub_interface.py
assert masked_input.count("<mask>") == 1
input_... | transformers/examples/legacy/run_camembert.py/0 | {
"file_path": "transformers/examples/legacy/run_camembert.py",
"repo_id": "transformers",
"token_count": 888
} |
# 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 ... | transformers/examples/legacy/seq2seq/old_test_fsmt_bleu_score.py/0 | {
"file_path": "transformers/examples/legacy/seq2seq/old_test_fsmt_bleu_score.py",
"repo_id": "transformers",
"token_count": 997
} |
#!/usr/bin/env python
import io
import json
import subprocess
pairs = [
["en", "ru"],
["ru", "en"],
["en", "de"],
["de", "en"],
]
n_objs = 8
def get_all_data(pairs, n_objs):
text = {}
for src, tgt in pairs:
pair = f"{src}-{tgt}"
cmd = f"sacrebleu -t wmt19 -l {pair} --echo s... | transformers/examples/legacy/seq2seq/test_data/fsmt/build-eval-data.py/0 | {
"file_path": "transformers/examples/legacy/seq2seq/test_data/fsmt/build-eval-data.py",
"repo_id": "transformers",
"token_count": 410
} |
## Token classification
Based on the scripts [`run_ner.py`](https://github.com/huggingface/transformers/blob/main/examples/legacy/token-classification/run_ner.py).
The following examples are covered in this section:
* NER on the GermEval 2014 (German NER) dataset
* Emerging and Rare Entities task: WNUTโ17 (English N... | transformers/examples/legacy/token-classification/README.md/0 | {
"file_path": "transformers/examples/legacy/token-classification/README.md",
"repo_id": "transformers",
"token_count": 4566
} |
# ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ๐จ
# This file was automatically generated from examples/modular-transformers/modular_add_function.py.
# Do NOT edit this file manually as any edits will be overwritten by the generatio... | transformers/examples/modular-transformers/modeling_add_function.py/0 | {
"file_path": "transformers/examples/modular-transformers/modeling_add_function.py",
"repo_id": "transformers",
"token_count": 1596
} |
"""
Here, because clip is not consistent with the use of the "Text" and "Vision" prefixes, we cannot simply use
```
class Multimodal2VisionModel(CLIPVisionModel):
pass
```
with the hope that all dependencies will be renamed as `Multimodal2VisionClass`. For this reason, if we want consistency and
use the "Vision" pa... | transformers/examples/modular-transformers/modular_multimodal2.py/0 | {
"file_path": "transformers/examples/modular-transformers/modular_multimodal2.py",
"repo_id": "transformers",
"token_count": 1094
} |
# coding=utf-8
# Copyright 2024 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... | transformers/examples/pytorch/object-detection/run_object_detection_no_trainer.py/0 | {
"file_path": "transformers/examples/pytorch/object-detection/run_object_detection_no_trainer.py",
"repo_id": "transformers",
"token_count": 13163
} |
<!---
Copyright 2021 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 applicable law or ... | transformers/examples/pytorch/speech-pretraining/README.md/0 | {
"file_path": "transformers/examples/pytorch/speech-pretraining/README.md",
"repo_id": "transformers",
"token_count": 2600
} |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2020 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/LI... | transformers/examples/pytorch/text-classification/run_classification.py/0 | {
"file_path": "transformers/examples/pytorch/text-classification/run_classification.py",
"repo_id": "transformers",
"token_count": 13914
} |
#!/usr/bin/env python
# coding=utf-8
# Copyright The HuggingFace Team 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... | transformers/examples/pytorch/translation/run_translation.py/0 | {
"file_path": "transformers/examples/pytorch/translation/run_translation.py",
"repo_id": "transformers",
"token_count": 12307
} |
from dataclasses import dataclass, field
from typing import Optional
@dataclass
class TrainingArguments:
"""
Configuration for training model.
"""
model_ckpt: Optional[str] = field(
default="codeparrot/codeparrot", metadata={"help": "Model name or path of model to be trained."}
)
save... | transformers/examples/research_projects/codeparrot/scripts/arguments.py/0 | {
"file_path": "transformers/examples/research_projects/codeparrot/scripts/arguments.py",
"repo_id": "transformers",
"token_count": 3565
} |
# 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... | transformers/examples/research_projects/distillation/scripts/token_counts.py/0 | {
"file_path": "transformers/examples/research_projects/distillation/scripts/token_counts.py",
"repo_id": "transformers",
"token_count": 726
} |
<!---
Copyright 2021 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 applicable law or ... | transformers/examples/research_projects/jax-projects/hybrid_clip/README.md/0 | {
"file_path": "transformers/examples/research_projects/jax-projects/hybrid_clip/README.md",
"repo_id": "transformers",
"token_count": 2322
} |
## MM-IMDb
Based on the script [`run_mmimdb.py`](https://github.com/huggingface/transformers/blob/main/examples/research_projects/mm-imdb/run_mmimdb.py).
[MM-IMDb](http://lisi1.unal.edu.co/mmimdb/) is a Multimodal dataset with around 26,000 movies including images, plots and other metadata.
### Training on MM-IMDb
... | transformers/examples/research_projects/mm-imdb/README.md/0 | {
"file_path": "transformers/examples/research_projects/mm-imdb/README.md",
"repo_id": "transformers",
"token_count": 287
} |
<!---
Copyright 2021 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 applicable law or a... | transformers/examples/research_projects/onnx/summarization/README.md/0 | {
"file_path": "transformers/examples/research_projects/onnx/summarization/README.md",
"repo_id": "transformers",
"token_count": 463
} |
#! /usr/bin/env python3
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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 ... | transformers/examples/research_projects/pplm/run_pplm.py/0 | {
"file_path": "transformers/examples/research_projects/pplm/run_pplm.py",
"repo_id": "transformers",
"token_count": 13443
} |
import os
from functools import partial
from glob import glob
import faiss
from datasets import Features, Sequence, Value, concatenate_datasets, load_dataset, load_from_disk
from transformers import DPRContextEncoder, DPRContextEncoderTokenizerFast
def split_text(text, n=100, character=" "):
"""Split the text e... | transformers/examples/research_projects/rag-end2end-retriever/kb_encode_utils.py/0 | {
"file_path": "transformers/examples/research_projects/rag-end2end-retriever/kb_encode_utils.py",
"repo_id": "transformers",
"token_count": 1231
} |
import json
import logging
import os
import sys
from pathlib import Path
import finetune_rag
from transformers.file_utils import is_apex_available
from transformers.testing_utils import (
TestCasePlus,
execute_subprocess_async,
require_ray,
require_torch_gpu,
require_torch_multi_gpu,
)
logging.b... | transformers/examples/research_projects/rag/_test_finetune_rag.py/0 | {
"file_path": "transformers/examples/research_projects/rag/_test_finetune_rag.py",
"repo_id": "transformers",
"token_count": 1994
} |
# Robust Speech Challenge ๐ค
Welcome to the robust speech recognition challenge ๐๏ธ !
The goal of this event is to build **robust**, **real-world** speech recognition (ASR) systems in as many languages as possible ๐๐๐.
If necessary and available, free access to a V100S 32 GB GPU will kindly be provided by the [OVH... | transformers/examples/research_projects/robust-speech-event/README.md/0 | {
"file_path": "transformers/examples/research_projects/robust-speech-event/README.md",
"repo_id": "transformers",
"token_count": 12253
} |
#!/usr/bin/env bash
export PYTHONPATH="../":"${PYTHONPATH}"
export WANDB_PROJECT=dmar
# export MAX_LEN=128
python distillation.py \
--learning_rate=3e-4 \
--do_train \
--fp16 \
--val_check_interval 0.25 \
--teacher Helsinki-NLP/opus-mt-en-ro \
--max_source_length $MAX_LEN --max_target_length $MAX_LEN --val_... | transformers/examples/research_projects/seq2seq-distillation/distil_marian_enro_teacher.sh/0 | {
"file_path": "transformers/examples/research_projects/seq2seq-distillation/distil_marian_enro_teacher.sh",
"repo_id": "transformers",
"token_count": 310
} |
#!/usr/bin/env bash
export PYTHONPATH="../":"${PYTHONPATH}"
python distillation.py \
--teacher facebook/bart-large-xsum --data_dir xsum \
--tokenizer_name facebook/bart-large-xsum \
--student_decoder_layers 6 --student_encoder_layers 12 \
--freeze_encoder --freeze_embeds \
--learning_rate=3e-4 \
--do_train ... | transformers/examples/research_projects/seq2seq-distillation/train_distilbart_xsum.sh/0 | {
"file_path": "transformers/examples/research_projects/seq2seq-distillation/train_distilbart_xsum.sh",
"repo_id": "transformers",
"token_count": 317
} |
<jupyter_start><jupyter_code># %pip install-r requirements.txt<jupyter_output><empty_output><jupyter_text>**Note**: This demo is adapted from the LXMERT Demo present here: https://github.com/huggingface/transformers/tree/main/examples/research_projects/lxmert<jupyter_code>from IPython.display import Image, display
impo... | transformers/examples/research_projects/visual_bert/demo.ipynb/0 | {
"file_path": "transformers/examples/research_projects/visual_bert/demo.ipynb",
"repo_id": "transformers",
"token_count": 1630
} |
{
"fp16": {
"enabled": "auto",
"loss_scale": 0,
"loss_scale_window": 1000,
"initial_scale_power": 16,
"hysteresis": 2,
"min_loss_scale": 1
},
"optimizer": {
"type": "AdamW",
"params": {
"lr": "auto",
"betas": "auto",
... | transformers/examples/research_projects/wav2vec2/ds_config_wav2vec2_zero2.json/0 | {
"file_path": "transformers/examples/research_projects/wav2vec2/ds_config_wav2vec2_zero2.json",
"repo_id": "transformers",
"token_count": 669
} |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2023 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/LI... | transformers/examples/tensorflow/language-modeling-tpu/run_mlm.py/0 | {
"file_path": "transformers/examples/tensorflow/language-modeling-tpu/run_mlm.py",
"repo_id": "transformers",
"token_count": 4387
} |
# coding=utf-8
# Copyright 2022 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... | transformers/examples/tensorflow/test_tensorflow_examples.py/0 | {
"file_path": "transformers/examples/tensorflow/test_tensorflow_examples.py",
"repo_id": "transformers",
"token_count": 5486
} |
#!/usr/bin/env python
#
# This a `torch.distributed` diagnostics script that checks that all GPUs in the cluster (one or
# many nodes) can talk to each other via nccl and allocate gpu memory.
#
# To run first adjust the number of processes and nodes:
#
# python -m torch.distributed.run --nproc_per_node 2 --nnodes 1 to... | transformers/scripts/distributed/torch-distributed-gpu-test.py/0 | {
"file_path": "transformers/scripts/distributed/torch-distributed-gpu-test.py",
"repo_id": "transformers",
"token_count": 1240
} |
<!---
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 applicable law or ... | transformers/scripts/tatoeba/README.md/0 | {
"file_path": "transformers/scripts/tatoeba/README.md",
"repo_id": "transformers",
"token_count": 761
} |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2024 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/L... | transformers/src/transformers/agents/python_interpreter.py/0 | {
"file_path": "transformers/src/transformers/agents/python_interpreter.py",
"repo_id": "transformers",
"token_count": 15397
} |
# 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... | transformers/src/transformers/commands/run.py/0 | {
"file_path": "transformers/src/transformers/commands/run.py",
"repo_id": "transformers",
"token_count": 1665
} |
# 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... | transformers/src/transformers/data/datasets/squad.py/0 | {
"file_path": "transformers/src/transformers/data/datasets/squad.py",
"repo_id": "transformers",
"token_count": 4006
} |
from abc import ABC, abstractmethod
from typing import List, Optional
class Constraint(ABC):
r"""Abstract base class for all constraints that can be applied during generation.
It must define how the constraint can be satisfied.
All classes that inherit Constraint must follow the requirement that
```... | transformers/src/transformers/generation/beam_constraints.py/0 | {
"file_path": "transformers/src/transformers/generation/beam_constraints.py",
"repo_id": "transformers",
"token_count": 8383
} |
# coding=utf-8
# Copyright 2022 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... | transformers/src/transformers/image_processing_utils.py/0 | {
"file_path": "transformers/src/transformers/image_processing_utils.py",
"repo_id": "transformers",
"token_count": 5283
} |
# coding=utf-8
# Copyright 2024 The ggml.ai team and The HuggingFace Inc. team. and pygguf author (github.com/99991)
# https://github.com/99991/pygguf
#
# 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 Lic... | transformers/src/transformers/integrations/ggml.py/0 | {
"file_path": "transformers/src/transformers/integrations/ggml.py",
"repo_id": "transformers",
"token_count": 12259
} |
/*!
**************************************************************************************************
* Deformable DETR
* Copyright (c) 2020 SenseTime. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 [see LICENSE for details]
***********************************************************************... | transformers/src/transformers/kernels/deformable_detr/cuda/ms_deform_attn_cuda.cuh/0 | {
"file_path": "transformers/src/transformers/kernels/deformable_detr/cuda/ms_deform_attn_cuda.cuh",
"repo_id": "transformers",
"token_count": 34797
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.