file_name large_stringlengths 6 73 | file_path large_stringlengths 8 117 | type large_stringclasses 3 values | name large_stringlengths 1 91 | start_line int64 1 6.25k | end_line int64 5 6.27k | content large_stringlengths 18 250k | docstring large_stringlengths 0 41.1k ⌀ | embedding listlengths 768 768 | embedding_model large_stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|
conftest.py | conftest.py | function | pytest_configure | 84 | 95 | def pytest_configure(config):
config.addinivalue_line("markers", "is_pipeline_test: mark test to run only when pipelines are tested")
config.addinivalue_line("markers", "is_staging_test: mark test to run only in the staging environment")
config.addinivalue_line("markers", "accelerate_tests: mark test that require accelerate")
config.addinivalue_line("markers", "not_device_test: mark the tests always running on cpu")
config.addinivalue_line("markers", "torch_compile_test: mark test which tests torch compile functionality")
config.addinivalue_line("markers", "torch_export_test: mark test which tests torch export functionality")
config.addinivalue_line("markers", "flash_attn_test: mark test which tests flash attention functionality")
config.addinivalue_line("markers", "flash_attn_3_test: mark test which tests flash attention 3 functionality")
config.addinivalue_line("markers", "training_ci: mark test for training CI validation")
os.environ["DISABLE_SAFETENSORS_CONVERSION"] = "true" | null | [
-0.006010689772665501,
-0.01654973439872265,
-0.010188373737037182,
0.026173338294029236,
0.005266346037387848,
0.030715258792042732,
-0.051606494933366776,
0.01947873644530773,
0.025859253481030464,
-0.0019574088510125875,
-0.036790698766708374,
0.028762491419911385,
-0.011060409247875214,
... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | function | pytest_collection_modifyitems | 98 | 101 | def pytest_collection_modifyitems(items):
for item in items:
if any(test_name in item.nodeid for test_name in NOT_DEVICE_TESTS):
item.add_marker(pytest.mark.not_device_test) | null | [
-0.0018598344177007675,
-0.01407221145927906,
0.0098698316141963,
0.011602354235947132,
0.04331904277205467,
0.021711518988013268,
-0.043311864137649536,
0.010872561484575272,
-0.0018784116255119443,
-0.03966418653726578,
0.005111444275826216,
0.032855890691280365,
-0.06387723237276077,
0.... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | function | pytest_addoption | 104 | 107 | def pytest_addoption(parser):
from transformers.testing_utils import pytest_addoption_shared
pytest_addoption_shared(parser) | null | [
0.02109464816749096,
-0.015749573707580566,
0.003046265570446849,
0.006348882336169481,
-0.04745549336075783,
0.018048813566565514,
-0.02918238379061222,
-0.007588644977658987,
0.01914861798286438,
0.0010566345881670713,
-0.03797975927591324,
-0.0010851150145754218,
-0.012139503844082355,
... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | function | pytest_terminal_summary | 110 | 115 | def pytest_terminal_summary(terminalreporter):
from transformers.testing_utils import pytest_terminal_summary_main
make_reports = terminalreporter.config.getoption("--make-reports")
if make_reports:
pytest_terminal_summary_main(terminalreporter, id=make_reports) | null | [
-0.0030817899387329817,
-0.03523353114724159,
-0.0006435674149543047,
-0.024024685844779015,
-0.007272584363818169,
0.008798833936452866,
-0.03417857363820076,
0.01577366515994072,
0.0157461054623127,
-0.028448527678847313,
-0.05114568769931793,
0.03233640640974045,
-0.011357183568179607,
... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | function | pytest_sessionfinish | 118 | 121 | def pytest_sessionfinish(session, exitstatus):
# If no tests are collected, pytest exists with code 5, which makes the CI fail.
if exitstatus == 5:
session.exitstatus = 0 | null | [
0.009401445277035236,
-0.06394325941801071,
0.015375849790871143,
0.05399767681956291,
0.012109951116144657,
0.019510721787810326,
0.01785055175423622,
-0.017624689266085625,
0.059219278395175934,
-0.023134123533964157,
-0.019102929159998894,
0.0022015392314642668,
0.0017136919777840376,
0... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | class | CustomOutputChecker | 130 | 134 | class CustomOutputChecker(OutputChecker):
def check_output(self, want, got, optionflags):
if IGNORE_RESULT & optionflags:
return True
return OutputChecker.check_output(self, want, got, optionflags) | null | [
-0.0015353856142610312,
0.03293216601014137,
0.04843374341726303,
0.016692599281668663,
0.00967515166848898,
0.008680326864123344,
-0.03601459786295891,
-0.01175685040652752,
-0.03537588566541672,
-0.017700154334306717,
0.00032964692218229175,
0.05489371716976166,
-0.0347469300031662,
0.05... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | function | check_output | 131 | 134 | def check_output(self, want, got, optionflags):
if IGNORE_RESULT & optionflags:
return True
return OutputChecker.check_output(self, want, got, optionflags) | null | [
-0.0050439084880054,
0.043086420744657516,
0.02921714261174202,
0.009142640046775341,
0.02405254729092121,
0.008396622724831104,
-0.042850691825151443,
-0.02747061289846897,
-0.02396944724023342,
-0.005572537891566753,
-0.04155103489756584,
0.04938877746462822,
-0.024951333180069923,
0.067... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | consecutive_lines | lines_1-50 | 1 | 50 | # 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 to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# tests directory-specific settings - this file is run automatically
# by pytest before any tests are run
import doctest
import os
import sys
import warnings
from os.path import abspath, dirname, join
import _pytest
import pytest
from transformers.testing_utils import (
HfDoctestModule,
HfDocTestParser,
is_torch_available,
patch_testing_methods_to_collect_info,
patch_torch_compile_force_graph,
)
from transformers.utils import enable_tf32
NOT_DEVICE_TESTS = {
"test_tokenization",
"test_tokenization_mistral_common",
"test_processing",
"test_beam_constraints",
"test_configuration_utils",
"test_data_collator",
"test_trainer_callback",
"test_trainer_utils",
"test_feature_extraction",
"test_image_processing",
"test_image_processor",
"test_image_transforms",
"test_optimization", | null | [
-0.006435020361095667,
-0.0145240044221282,
-0.0035980921238660812,
-0.013333169743418694,
-0.004700838588178158,
0.0468064546585083,
-0.03010897897183895,
-0.009453308768570423,
0.010752719826996326,
0.005468118004500866,
-0.08877290040254593,
-0.0037409691140055656,
-0.0323854461312294,
... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | consecutive_lines | lines_41-90 | 41 | 90 | "test_beam_constraints",
"test_configuration_utils",
"test_data_collator",
"test_trainer_callback",
"test_trainer_utils",
"test_feature_extraction",
"test_image_processing",
"test_image_processor",
"test_image_transforms",
"test_optimization",
"test_retrieval",
"test_config",
"test_from_pretrained_no_checkpoint",
"test_keep_in_fp32_modules",
"test_gradient_checkpointing_backward_compatibility",
"test_gradient_checkpointing_enable_disable",
"test_torch_save_load",
"test_forward_signature",
"test_model_get_set_embeddings",
"test_model_main_input_name",
"test_correct_missing_keys",
"test_can_use_safetensors",
"test_load_save_without_tied_weights",
"test_tied_weights_keys",
"test_model_weights_reload_no_missing_tied_weights",
"test_can_load_ignoring_mismatched_shapes",
"test_model_is_small",
"ModelTest::test_pipeline_", # None of the pipeline tests from PipelineTesterMixin (of which XxxModelTest inherits from) are running on device
"ModelTester::test_pipeline_",
"/repo_utils/",
"/utils/",
}
# allow having multiple repository checkouts and not needing to remember to rerun
# `pip install -e '.[dev]'` when switching between checkouts and running tests.
git_repo_path = abspath(join(dirname(__file__), "src"))
sys.path.insert(1, git_repo_path)
# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action="ignore", category=FutureWarning)
def pytest_configure(config):
config.addinivalue_line("markers", "is_pipeline_test: mark test to run only when pipelines are tested")
config.addinivalue_line("markers", "is_staging_test: mark test to run only in the staging environment")
config.addinivalue_line("markers", "accelerate_tests: mark test that require accelerate")
config.addinivalue_line("markers", "not_device_test: mark the tests always running on cpu")
config.addinivalue_line("markers", "torch_compile_test: mark test which tests torch compile functionality")
config.addinivalue_line("markers", "torch_export_test: mark test which tests torch export functionality") | null | [
-0.03938659280538559,
-0.005469099618494511,
0.00622708210721612,
0.004732238128781319,
-0.0029964945279061794,
0.041295234113931656,
-0.04239056259393692,
0.0011579382698982954,
0.004169244784861803,
0.0023165540769696236,
-0.05699987709522247,
-0.00005019697346142493,
-0.0304555781185627,
... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | consecutive_lines | lines_81-130 | 81 | 130 | warnings.simplefilter(action="ignore", category=FutureWarning)
def pytest_configure(config):
config.addinivalue_line("markers", "is_pipeline_test: mark test to run only when pipelines are tested")
config.addinivalue_line("markers", "is_staging_test: mark test to run only in the staging environment")
config.addinivalue_line("markers", "accelerate_tests: mark test that require accelerate")
config.addinivalue_line("markers", "not_device_test: mark the tests always running on cpu")
config.addinivalue_line("markers", "torch_compile_test: mark test which tests torch compile functionality")
config.addinivalue_line("markers", "torch_export_test: mark test which tests torch export functionality")
config.addinivalue_line("markers", "flash_attn_test: mark test which tests flash attention functionality")
config.addinivalue_line("markers", "flash_attn_3_test: mark test which tests flash attention 3 functionality")
config.addinivalue_line("markers", "training_ci: mark test for training CI validation")
os.environ["DISABLE_SAFETENSORS_CONVERSION"] = "true"
def pytest_collection_modifyitems(items):
for item in items:
if any(test_name in item.nodeid for test_name in NOT_DEVICE_TESTS):
item.add_marker(pytest.mark.not_device_test)
def pytest_addoption(parser):
from transformers.testing_utils import pytest_addoption_shared
pytest_addoption_shared(parser)
def pytest_terminal_summary(terminalreporter):
from transformers.testing_utils import pytest_terminal_summary_main
make_reports = terminalreporter.config.getoption("--make-reports")
if make_reports:
pytest_terminal_summary_main(terminalreporter, id=make_reports)
def pytest_sessionfinish(session, exitstatus):
# If no tests are collected, pytest exists with code 5, which makes the CI fail.
if exitstatus == 5:
session.exitstatus = 0
# Doctest custom flag to ignore output.
IGNORE_RESULT = doctest.register_optionflag("IGNORE_RESULT")
OutputChecker = doctest.OutputChecker
class CustomOutputChecker(OutputChecker): | null | [
-0.008784526027739048,
0.0026440047658979893,
-0.007121329195797443,
0.002730834996327758,
0.0043590981513261795,
0.01764943078160286,
-0.037327203899621964,
0.020638270303606987,
0.026348697021603584,
0.012500341981649399,
-0.04141455143690109,
0.02316303551197052,
-0.013417514972388744,
... | Snowflake/snowflake-arctic-embed-m |
conftest.py | conftest.py | consecutive_lines | lines_121-152 | 121 | 152 | session.exitstatus = 0
# Doctest custom flag to ignore output.
IGNORE_RESULT = doctest.register_optionflag("IGNORE_RESULT")
OutputChecker = doctest.OutputChecker
class CustomOutputChecker(OutputChecker):
def check_output(self, want, got, optionflags):
if IGNORE_RESULT & optionflags:
return True
return OutputChecker.check_output(self, want, got, optionflags)
doctest.OutputChecker = CustomOutputChecker
_pytest.doctest.DoctestModule = HfDoctestModule
doctest.DocTestParser = HfDocTestParser
if is_torch_available():
# The flag below controls whether to allow TF32 on cuDNN. This flag defaults to True.
# We set it to `False` for CI. See https://github.com/pytorch/pytorch/issues/157274#issuecomment-3090791615
enable_tf32(False)
# patch `torch.compile`: if `TORCH_COMPILE_FORCE_FULLGRAPH=1` (or values considered as true, e.g. yes, y, etc.),
# the patched version will always run with `fullgraph=True`.
patch_torch_compile_force_graph()
if os.environ.get("PATCH_TESTING_METHODS_TO_COLLECT_OUTPUTS", "").lower() in ("yes", "true", "on", "y", "1"):
patch_testing_methods_to_collect_info() | null | [
-0.015207345597445965,
-0.02301223762333393,
0.026528535410761833,
0.05873050540685654,
-0.023370616137981415,
-0.007472406141459942,
-0.04254474490880966,
0.005331215914338827,
0.04482090845704079,
-0.03774423524737358,
-0.0482192300260067,
0.04052731767296791,
0.005130629520863295,
0.065... | Snowflake/snowflake-arctic-embed-m |
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 19
Size of downloaded dataset files:
359 MB
Size of the auto-converted Parquet files:
359 MB
Number of rows:
101,324