Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions benchmarks/benchmark_array_xd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import os
import tempfile

from utils import generate_examples, get_duration

import datasets
from datasets.arrow_writer import ArrowWriter
from datasets.features import Array2D
from utils import generate_examples, get_duration


SHAPE_TEST_1 = (30, 487)
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_getitem_100B.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

import numpy as np
import pyarrow as pa
from utils import get_duration

import datasets
from utils import get_duration


SPEED_TEST_N_EXAMPLES = 100_000_000_000
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmark_indices_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
import os
import tempfile

from utils import generate_example_dataset, get_duration

import datasets
from utils import generate_example_dataset, get_duration


SPEED_TEST_N_EXAMPLES = 500_000
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/benchmark_iterating.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
import os
import tempfile

from utils import generate_example_dataset, get_duration

import datasets
from utils import generate_example_dataset, get_duration


SPEED_TEST_N_EXAMPLES = 50_000
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmark_map_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import tempfile

import transformers
from utils import generate_example_dataset, get_duration

import datasets
from utils import generate_example_dataset, get_duration


SPEED_TEST_N_EXAMPLES = 500_000
Expand Down
2 changes: 1 addition & 1 deletion docs/source/_static/js/custom.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// These two things need to be updated at each release for the version selector.
// Last stable version
const stableVersion = "v1.5.0"
const stableVersion = "v1.8.0"
// Dictionary doc folder to label
const versionMapping = {
"master": "master",
Expand Down
51 changes: 51 additions & 0 deletions utils/release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# coding=utf-8
# 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 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.

import argparse


CUSTOM_JS_FILE = "docs/source/_static/js/custom.js"


def update_custom_js(version):
"""Update the version table in the custom.js file."""
with open(CUSTOM_JS_FILE, "r", encoding="utf-8", newline="\n") as f:
lines = f.readlines()
index = 0

# First let's put the right version
while not lines[index].startswith("const stableVersion ="):
index += 1
lines[index] = f'const stableVersion = "v{version}"\n'

# Then update the dictionary
while not lines[index].startswith("const versionMapping = {"):
index += 1

# We go until the end
while not lines[index].startswith("}"):
index += 1
# We add the new version at the end
lines[index - 1] += f' "v{version}": "v{version}",\n'

with open(CUSTOM_JS_FILE, "w", encoding="utf-8", newline="\n") as f:
f.writelines(lines)


if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--version", help="Release version.")
args = parser.parse_args()
update_custom_js(args.version)