fisrt commit
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- LICENSE +21 -0
- README.md +69 -1
- __pycache__/configuration_rotobart.cpython-38.pyc +0 -0
- __pycache__/data_collator.cpython-38.pyc +0 -0
- __pycache__/modeling_flax_rotobart.cpython-38.pyc +0 -0
- __pycache__/rotobart_utils.cpython-38.pyc +0 -0
- build_env.sh +6 -0
- configuration_rotobart.py +187 -0
- data_collator.py +390 -0
- jax_env/bin/Activate.ps1 +241 -0
- jax_env/bin/activate +76 -0
- jax_env/bin/activate.csh +37 -0
- jax_env/bin/activate.fish +75 -0
- jax_env/bin/easy_install +8 -0
- jax_env/bin/easy_install-3.8 +8 -0
- jax_env/bin/pip +8 -0
- jax_env/bin/pip3 +8 -0
- jax_env/bin/pip3.8 +8 -0
- jax_env/bin/python +1 -0
- jax_env/bin/python3 +1 -0
- jax_env/lib/python3.8/site-packages/__pycache__/easy_install.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/easy_install.py +5 -0
- jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/INSTALLER +1 -0
- jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/LICENSE.txt +20 -0
- jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/METADATA +84 -0
- jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/RECORD +246 -0
- jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/WHEEL +6 -0
- jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/entry_points.txt +5 -0
- jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/top_level.txt +1 -0
- jax_env/lib/python3.8/site-packages/pip/__init__.py +18 -0
- jax_env/lib/python3.8/site-packages/pip/__main__.py +19 -0
- jax_env/lib/python3.8/site-packages/pip/__pycache__/__init__.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/__pycache__/__main__.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__init__.py +18 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/__init__.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/build_env.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/cache.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/configuration.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/exceptions.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/legacy_resolve.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/locations.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/main.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/pep425tags.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/pyproject.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/self_outdated_check.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/wheel_builder.cpython-38.pyc +0 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/build_env.py +221 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/cache.py +329 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/cli/__init__.py +4 -0
- jax_env/lib/python3.8/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-38.pyc +0 -0
LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) 2021 Morgan McGuire
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
README.md
CHANGED
@@ -1 +1,69 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# RotoBART
|
2 |
+
|
3 |
+
## Running the script
|
4 |
+
|
5 |
+
### Script arguemnts
|
6 |
+
|
7 |
+
Available model config arguments from script:
|
8 |
+
```
|
9 |
+
encoder_layers
|
10 |
+
encoder_ffn_dim
|
11 |
+
decoder_layers
|
12 |
+
decoder_ffn_dim
|
13 |
+
d_model
|
14 |
+
vocab_size
|
15 |
+
max_position_embeddings
|
16 |
+
encoder_layerdrop
|
17 |
+
decoder_layerdrop
|
18 |
+
```
|
19 |
+
|
20 |
+
Training Arguments:
|
21 |
+
|
22 |
+
`testing` : only uses 1 batch, for testing the script
|
23 |
+
|
24 |
+
`adafactor`: will enable adafactor, removing the command will revert to Adam
|
25 |
+
|
26 |
+
`grad_accum`: what value for gradient accumulation to use, default is 4
|
27 |
+
|
28 |
+
`use_bf16`: convert the model to bf16
|
29 |
+
|
30 |
+
`colab_tpu`: if running on a colab TPU
|
31 |
+
|
32 |
+
`use_wandb`: log using Weights & Biases (via Tensorboard)
|
33 |
+
|
34 |
+
`save_strategy`: whether or not to save model checkpoints based on steps or epoch
|
35 |
+
|
36 |
+
|
37 |
+
```
|
38 |
+
python rotobart/run_dnlm_flax.py \
|
39 |
+
--output_dir rotobart_output \
|
40 |
+
--overwrite_output_dir \
|
41 |
+
--dataset_path rotobart/pile.py \
|
42 |
+
--model_name_or_path rotobart \
|
43 |
+
--tokenizer_name ./rotobart/vocab-2/the_pile.model \
|
44 |
+
--shuffle_buffer_size 1000 \
|
45 |
+
--do_train --do_eval \
|
46 |
+
--max_seq_length 1024 \
|
47 |
+
--encoder_layers 2 \
|
48 |
+
--decoder_layers 2 \
|
49 |
+
--per_device_train_batch_size 2 \
|
50 |
+
--per_device_eval_batch_size 2 \
|
51 |
+
--logging_steps 8 \
|
52 |
+
--num_train_steps 1000 \
|
53 |
+
--eval_steps 1000 \
|
54 |
+
--save_steps 1000 \
|
55 |
+
--save_strategy steps \
|
56 |
+
--num_eval_samples 100 \
|
57 |
+
--warmup_steps 30 \
|
58 |
+
--learning_rate 1e-4 \
|
59 |
+
--use_wandb \
|
60 |
+
--testing \
|
61 |
+
--use_bf16 \
|
62 |
+
--adafactor
|
63 |
+
```
|
64 |
+
|
65 |
+
alt
|
66 |
+
|
67 |
+
```
|
68 |
+
python3 run_dnlm_flax.py --output_dir rotobart_output --overwrite_output_dir --dataset_path pile.py --model_name_or_path rotobart --tokenizer_name vocab-2/the_pile.model --shuffle_buffer_size 1000 --do_train --do_eval --max_position_embeddings 2048 --max_seq_length 2048 --encoder_layers 6 --decoder_layers 6 --per_device_train_batch_size 1 --per_device_eval_batch_size 1 --logging_steps 100 --num_train_steps 50000 --eval_steps 2500 --save_steps 2500 --save_strategy steps --num_eval_samples 5000 --warmup_steps 5000 --learning_rate 1e-4 --use_wandb --use_bf16 --adafactor
|
69 |
+
```
|
__pycache__/configuration_rotobart.cpython-38.pyc
ADDED
Binary file (7.72 kB). View file
|
|
__pycache__/data_collator.cpython-38.pyc
ADDED
Binary file (10.4 kB). View file
|
|
__pycache__/modeling_flax_rotobart.cpython-38.pyc
ADDED
Binary file (47.6 kB). View file
|
|
__pycache__/rotobart_utils.cpython-38.pyc
ADDED
Binary file (1.34 kB). View file
|
|
build_env.sh
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
export USE_TORCH=False
|
2 |
+
python3 -m venv jax_env
|
3 |
+
source ~/jax_env/bin/activate
|
4 |
+
pip install --upgrade pip
|
5 |
+
pip install "jax[tpu]>=0.2.16" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
|
6 |
+
pip install transformers datasets einops flax aiohttp jsonlines zstandard wandb SentencePiece nltk prefetch_generator torch tensorboard tensorflow
|
configuration_rotobart.py
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# coding=utf-8
|
2 |
+
# Copyright 2021 The Fairseq Authors and The HuggingFace Inc. team. All rights reserved.
|
3 |
+
#
|
4 |
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
+
# you may not use this file except in compliance with the License.
|
6 |
+
# You may obtain a copy of the License at
|
7 |
+
#
|
8 |
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9 |
+
#
|
10 |
+
# Unless required by applicable law or agreed to in writing, software
|
11 |
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
+
# See the License for the specific language governing permissions and
|
14 |
+
# limitations under the License.
|
15 |
+
""" RotoBART model configuration """
|
16 |
+
import warnings
|
17 |
+
|
18 |
+
from transformers.configuration_utils import PretrainedConfig
|
19 |
+
from transformers.utils import logging
|
20 |
+
|
21 |
+
logger = logging.get_logger(__name__)
|
22 |
+
|
23 |
+
RotoBART_PRETRAINED_CONFIG_ARCHIVE_MAP = {
|
24 |
+
"facebook/RotoBART-large": "https://huggingface.co/facebook/RotoBART-large/resolve/main/config.json",
|
25 |
+
# See all RotoBART models at https://huggingface.co/models?filter=RotoBART
|
26 |
+
}
|
27 |
+
|
28 |
+
|
29 |
+
class RotoBARTConfig(PretrainedConfig):
|
30 |
+
r"""
|
31 |
+
This is the configuration class to store the configuration of a :class:`~transformers.RotoBARTModel`. It is used to
|
32 |
+
instantiate a RotoBART model according to the specified arguments, defining the model architecture. Instantiating a
|
33 |
+
configuration with the defaults will yield a similar configuration to that of the RotoBART `facebook/RotoBART-large
|
34 |
+
<https://huggingface.co/facebook/RotoBART-large>`__ architecture.
|
35 |
+
|
36 |
+
Configuration objects inherit from :class:`~transformers.PretrainedConfig` and can be used to control the model
|
37 |
+
outputs. Read the documentation from :class:`~transformers.PretrainedConfig` for more information.
|
38 |
+
|
39 |
+
|
40 |
+
Args:
|
41 |
+
vocab_size (:obj:`int`, `optional`, defaults to 50265):
|
42 |
+
Vocabulary size of the RotoBART model. Defines the number of different tokens that can be represented by the
|
43 |
+
:obj:`inputs_ids` passed when calling :class:`~transformers.RotoBARTModel` or
|
44 |
+
:class:`~transformers.TFRotoBARTModel`.
|
45 |
+
d_model (:obj:`int`, `optional`, defaults to 1024):
|
46 |
+
Dimensionality of the layers and the pooler layer.
|
47 |
+
encoder_layers (:obj:`int`, `optional`, defaults to 12):
|
48 |
+
Number of encoder layers.
|
49 |
+
decoder_layers (:obj:`int`, `optional`, defaults to 12):
|
50 |
+
Number of decoder layers.
|
51 |
+
encoder_attention_heads (:obj:`int`, `optional`, defaults to 16):
|
52 |
+
Number of attention heads for each attention layer in the Transformer encoder.
|
53 |
+
decoder_attention_heads (:obj:`int`, `optional`, defaults to 16):
|
54 |
+
Number of attention heads for each attention layer in the Transformer decoder.
|
55 |
+
decoder_ffn_dim (:obj:`int`, `optional`, defaults to 4096):
|
56 |
+
Dimensionality of the "intermediate" (often named feed-forward) layer in decoder.
|
57 |
+
encoder_ffn_dim (:obj:`int`, `optional`, defaults to 4096):
|
58 |
+
Dimensionality of the "intermediate" (often named feed-forward) layer in decoder.
|
59 |
+
activation_function (:obj:`str` or :obj:`function`, `optional`, defaults to :obj:`"gelu"`):
|
60 |
+
The non-linear activation function (function or string) in the encoder and pooler. If string,
|
61 |
+
:obj:`"gelu"`, :obj:`"relu"`, :obj:`"silu"` and :obj:`"gelu_new"` are supported.
|
62 |
+
dropout (:obj:`float`, `optional`, defaults to 0.1):
|
63 |
+
The dropout probability for all fully connected layers in the embeddings, encoder, and pooler.
|
64 |
+
attention_dropout (:obj:`float`, `optional`, defaults to 0.0):
|
65 |
+
The dropout ratio for the attention probabilities.
|
66 |
+
activation_dropout (:obj:`float`, `optional`, defaults to 0.0):
|
67 |
+
The dropout ratio for activations inside the fully connected layer.
|
68 |
+
classifier_dropout (:obj:`float`, `optional`, defaults to 0.0):
|
69 |
+
The dropout ratio for classifier.
|
70 |
+
max_position_embeddings (:obj:`int`, `optional`, defaults to 1024):
|
71 |
+
The maximum sequence length that this model might ever be used with. Typically set this to something large
|
72 |
+
just in case (e.g., 512 or 1024 or 2048).
|
73 |
+
init_std (:obj:`float`, `optional`, defaults to 0.02):
|
74 |
+
The standard deviation of the truncated_normal_initializer for initializing all weight matrices.
|
75 |
+
encoder_layerdrop: (:obj:`float`, `optional`, defaults to 0.0):
|
76 |
+
The LayerDrop probability for the encoder. See the `LayerDrop paper <see
|
77 |
+
https://arxiv.org/abs/1909.11556>`__ for more details.
|
78 |
+
decoder_layerdrop: (:obj:`float`, `optional`, defaults to 0.0):
|
79 |
+
The LayerDrop probability for the decoder. See the `LayerDrop paper <see
|
80 |
+
https://arxiv.org/abs/1909.11556>`__ for more details.
|
81 |
+
gradient_checkpointing (:obj:`bool`, `optional`, defaults to :obj:`False`):
|
82 |
+
If True, use gradient checkpointing to save memory at the expense of slower backward pass.
|
83 |
+
scale_embedding (:obj:`bool`, `optional`, defaults to :obj:`False`):
|
84 |
+
Scale embeddings by diving by sqrt(d_model).
|
85 |
+
use_cache (:obj:`bool`, `optional`, defaults to :obj:`True`):
|
86 |
+
Whether or not the model should return the last key/values attentions (not used by all models).
|
87 |
+
num_labels: (:obj:`int`, `optional`, defaults to 3):
|
88 |
+
The number of labels to use in :class:`~transformers.RotoBARTForSequenceClassification`.
|
89 |
+
forced_eos_token_id (:obj:`int`, `optional`, defaults to 2):
|
90 |
+
The id of the token to force as the last generated token when :obj:`max_length` is reached. Usually set to
|
91 |
+
:obj:`eos_token_id`.
|
92 |
+
|
93 |
+
Example::
|
94 |
+
|
95 |
+
>>> from transformers import RotoBARTModel, RotoBARTConfig
|
96 |
+
|
97 |
+
>>> # Initializing a RotoBART facebook/RotoBART-large style configuration
|
98 |
+
>>> configuration = RotoBARTConfig()
|
99 |
+
|
100 |
+
>>> # Initializing a model from the facebook/RotoBART-large style configuration
|
101 |
+
>>> model = RotoBARTModel(configuration)
|
102 |
+
|
103 |
+
>>> # Accessing the model configuration
|
104 |
+
>>> configuration = model.config
|
105 |
+
"""
|
106 |
+
model_type = "RotoBART"
|
107 |
+
keys_to_ignore_at_inference = ["past_key_values"]
|
108 |
+
|
109 |
+
def __init__(
|
110 |
+
self,
|
111 |
+
vocab_size=50265,
|
112 |
+
max_position_embeddings=1024,
|
113 |
+
encoder_layers=12,
|
114 |
+
encoder_ffn_dim=4096,
|
115 |
+
encoder_attention_heads=16,
|
116 |
+
decoder_layers=12,
|
117 |
+
decoder_ffn_dim=4096,
|
118 |
+
decoder_attention_heads=16,
|
119 |
+
encoder_layerdrop=0.0,
|
120 |
+
decoder_layerdrop=0.0,
|
121 |
+
activation_function="gelu",
|
122 |
+
d_model=1024,
|
123 |
+
dropout=0.1,
|
124 |
+
attention_dropout=0.0,
|
125 |
+
activation_dropout=0.0,
|
126 |
+
init_std=0.02,
|
127 |
+
classifier_dropout=0.0,
|
128 |
+
scale_embedding=False,
|
129 |
+
gradient_checkpointing=False,
|
130 |
+
use_cache=True,
|
131 |
+
num_labels=3,
|
132 |
+
pad_token_id=1,
|
133 |
+
bos_token_id=0,
|
134 |
+
eos_token_id=2,
|
135 |
+
is_encoder_decoder=True,
|
136 |
+
decoder_start_token_id=2,
|
137 |
+
forced_eos_token_id=2,
|
138 |
+
**kwargs,
|
139 |
+
):
|
140 |
+
super().__init__(
|
141 |
+
num_labels=num_labels,
|
142 |
+
pad_token_id=pad_token_id,
|
143 |
+
bos_token_id=bos_token_id,
|
144 |
+
eos_token_id=eos_token_id,
|
145 |
+
is_encoder_decoder=is_encoder_decoder,
|
146 |
+
decoder_start_token_id=decoder_start_token_id,
|
147 |
+
forced_eos_token_id=forced_eos_token_id,
|
148 |
+
**kwargs,
|
149 |
+
)
|
150 |
+
|
151 |
+
self.vocab_size = vocab_size
|
152 |
+
self.max_position_embeddings = max_position_embeddings
|
153 |
+
self.d_model = d_model
|
154 |
+
self.encoder_ffn_dim = encoder_ffn_dim
|
155 |
+
self.encoder_layers = encoder_layers
|
156 |
+
self.encoder_attention_heads = encoder_attention_heads
|
157 |
+
self.decoder_ffn_dim = decoder_ffn_dim
|
158 |
+
self.decoder_layers = decoder_layers
|
159 |
+
self.decoder_attention_heads = decoder_attention_heads
|
160 |
+
self.dropout = dropout
|
161 |
+
self.attention_dropout = attention_dropout
|
162 |
+
self.activation_dropout = activation_dropout
|
163 |
+
self.activation_function = activation_function
|
164 |
+
self.init_std = init_std
|
165 |
+
self.encoder_layerdrop = encoder_layerdrop
|
166 |
+
self.decoder_layerdrop = decoder_layerdrop
|
167 |
+
self.classifier_dropout = classifier_dropout
|
168 |
+
self.use_cache = use_cache
|
169 |
+
self.num_hidden_layers = encoder_layers
|
170 |
+
self.gradient_checkpointing = gradient_checkpointing
|
171 |
+
self.scale_embedding = scale_embedding # scale factor will be sqrt(d_model) if True
|
172 |
+
|
173 |
+
# ensure backward compatibility for RotoBART CNN models
|
174 |
+
if self.forced_bos_token_id is None and kwargs.get("force_bos_token_to_be_generated", False):
|
175 |
+
self.forced_bos_token_id = self.bos_token_id
|
176 |
+
warnings.warn(
|
177 |
+
f"Please make sure the config includes `forced_bos_token_id={self.bos_token_id}` in future versions."
|
178 |
+
"The config can simply be saved and uploaded again to be fixed."
|
179 |
+
)
|
180 |
+
|
181 |
+
@property
|
182 |
+
def num_attention_heads(self) -> int:
|
183 |
+
return self.encoder_attention_heads
|
184 |
+
|
185 |
+
@property
|
186 |
+
def hidden_size(self) -> int:
|
187 |
+
return self.d_model
|
data_collator.py
ADDED
@@ -0,0 +1,390 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import math
|
2 |
+
from dataclasses import dataclass
|
3 |
+
from typing import Dict, List, Optional
|
4 |
+
|
5 |
+
import nltk
|
6 |
+
import numpy as np
|
7 |
+
from numpy.random import permutation, poisson
|
8 |
+
from transformers.data.data_collator import _torch_collate_batch
|
9 |
+
from transformers.tokenization_utils_base import BatchEncoding, PreTrainedTokenizerBase
|
10 |
+
|
11 |
+
nltk.download("punkt")
|
12 |
+
|
13 |
+
|
14 |
+
@dataclass
|
15 |
+
class DataCollatorForTextInfilling:
|
16 |
+
tokenizer: PreTrainedTokenizerBase
|
17 |
+
mlm_probability: float = 0.15
|
18 |
+
poisson_lambda: float = 3.0
|
19 |
+
pad_to_multiple_of: Optional[int] = None
|
20 |
+
|
21 |
+
def __post_init__(self):
|
22 |
+
if self.tokenizer.mask_token is None:
|
23 |
+
raise ValueError
|
24 |
+
|
25 |
+
def __call__(self, examples: List[Dict[str, np.ndarray]]) -> Dict[str, np.ndarray]:
|
26 |
+
# Handle dict or lists with proper padding and conversion to tensor.
|
27 |
+
batch = {}
|
28 |
+
if isinstance(examples, (dict, BatchEncoding)):
|
29 |
+
examples_ids = examples["input_ids"]
|
30 |
+
if "decoder_input_ids" in examples.keys():
|
31 |
+
examples_dec = examples["decoder_input_ids"]
|
32 |
+
else:
|
33 |
+
examples_dec = examples_ids
|
34 |
+
|
35 |
+
# bs of one
|
36 |
+
if type(examples_ids[0]) is int:
|
37 |
+
examples_ids = [examples_ids]
|
38 |
+
# bs of one
|
39 |
+
if type(examples_dec[0]) is int:
|
40 |
+
examples_dec = [examples_dec]
|
41 |
+
|
42 |
+
batch["input_ids"] = _torch_collate_batch(
|
43 |
+
examples_ids, self.tokenizer, pad_to_multiple_of=self.pad_to_multiple_of
|
44 |
+
)
|
45 |
+
batch["decoder_input_ids"] = _torch_collate_batch(
|
46 |
+
examples_dec, self.tokenizer, pad_to_multiple_of=self.pad_to_multiple_of
|
47 |
+
)
|
48 |
+
batch["decoder_input_ids"] = batch["decoder_input_ids"].tolist()
|
49 |
+
|
50 |
+
elif isinstance(examples[0], (dict, BatchEncoding)):
|
51 |
+
batch = self.tokenizer.pad(examples, return_tensors="jax", pad_to_multiple_of=self.pad_to_multiple_of)
|
52 |
+
else:
|
53 |
+
batch["input_ids"] = _torch_collate_batch(examples, self.tokenizer, pad_to_multiple_of=self.pad_to_multiple_of)
|
54 |
+
batch["decoder_input_ids"] = _torch_collate_batch(
|
55 |
+
examples, self.tokenizer, pad_to_multiple_of=self.pad_to_multiple_of
|
56 |
+
).tolist()
|
57 |
+
|
58 |
+
# If special token mask has been preprocessed, pop it from the dict.
|
59 |
+
special_tokens_mask = batch.pop("special_tokens_mask", None)
|
60 |
+
|
61 |
+
batch["input_ids"], batch["labels"] = self.mask_tokens(
|
62 |
+
batch["input_ids"], special_tokens_mask=special_tokens_mask
|
63 |
+
)
|
64 |
+
|
65 |
+
return batch
|
66 |
+
|
67 |
+
def mask_tokens(self, inputs):
|
68 |
+
inputs_copy = np.array(inputs)
|
69 |
+
labels = np.array(inputs)
|
70 |
+
if special_tokens_mask is None:
|
71 |
+
special_tokens_mask = [
|
72 |
+
self.tokenizer.get_special_tokens_mask(val, already_has_special_tokens=True) for val in labels.tolist()
|
73 |
+
]
|
74 |
+
special_tokens_mask = jnp.array(special_tokens_mask, dtype=bool)
|
75 |
+
else:
|
76 |
+
special_tokens_mask = special_tokens_mask.bool()
|
77 |
+
|
78 |
+
# determine how many tokens we need to mask in total
|
79 |
+
is_token = ~(labels == self.tokenizer.pad_token_id) & ~special_tokens_mask
|
80 |
+
num_to_mask = int(math.ceil(is_token.astype(float).sum() * self.mlm_probability))
|
81 |
+
if num_to_mask == 0:
|
82 |
+
return inputs, labels
|
83 |
+
|
84 |
+
# generate a sufficient number of span lengths
|
85 |
+
lengths = poisson(lam=self.poisson_lambda, size=(num_to_mask,))
|
86 |
+
while np.cumsum(lengths, 0)[-1] < num_to_mask:
|
87 |
+
lengths = np.concatenate([lengths, poisson(lam=self.poisson_lambda, size=(num_to_mask,))])
|
88 |
+
|
89 |
+
# remove all spans of length 0
|
90 |
+
# Note that BART inserts additional mask tokens where length == 0,
|
91 |
+
# which we do not implement for now as it adds additional complexity
|
92 |
+
lengths = lengths[lengths > 0]
|
93 |
+
|
94 |
+
# trim to about num_to_mask tokens
|
95 |
+
idx = np.argmin(np.abs(np.cumsum(lengths, 0) - num_to_mask)) + 1
|
96 |
+
lengths = lengths[: idx + 1]
|
97 |
+
|
98 |
+
# select span start indices
|
99 |
+
# print("IS TOKEN")
|
100 |
+
# print(is_token)
|
101 |
+
# print(sum(list(map(lambda x: 1 if(x) else 0, is_token[0]))))
|
102 |
+
token_indices = np.argwhere(is_token == 1)
|
103 |
+
# print("TOKEN INDICES")
|
104 |
+
# print(token_indices)
|
105 |
+
span_starts = permutation(token_indices.shape[0])[: lengths.shape[0]]
|
106 |
+
|
107 |
+
# prepare mask
|
108 |
+
masked_indices = np.array(token_indices[span_starts])
|
109 |
+
# print("MASKED INDICES")
|
110 |
+
# print(masked_indices)
|
111 |
+
mask = np.full_like(labels, fill_value=False)
|
112 |
+
|
113 |
+
# mask span start indices
|
114 |
+
for mi in masked_indices:
|
115 |
+
mask[tuple(mi)] = True
|
116 |
+
lengths -= 1
|
117 |
+
|
118 |
+
# fill up spans
|
119 |
+
max_index = labels.shape[1] - 1
|
120 |
+
remaining = (lengths > 0) & (masked_indices[:, 1] < max_index)
|
121 |
+
while np.any(remaining):
|
122 |
+
masked_indices[remaining, 1] += 1
|
123 |
+
for mi in masked_indices:
|
124 |
+
mask[tuple(mi)] = True
|
125 |
+
lengths -= 1
|
126 |
+
remaining = (lengths > 0) & (masked_indices[:, 1] < max_index)
|
127 |
+
|
128 |
+
# place the mask tokens
|
129 |
+
mask[np.where(special_tokens_mask == True)] = False
|
130 |
+
inputs_copy[np.where(mask == 1)] = self.tokenizer.mask_token_id
|
131 |
+
labels[np.where(mask == 0)] = -100
|
132 |
+
|
133 |
+
# remove mask tokens that are not starts of spans
|
134 |
+
to_remove = (mask == 1) & np.roll((mask == 1), 1, 1)
|
135 |
+
new_inputs = np.full_like(labels, fill_value=self.tokenizer.pad_token_id)
|
136 |
+
|
137 |
+
# splits = list(map(lambda x: x.reshape(-1), np.split(inputs_copy, indices_or_sections=2, axis=0))
|
138 |
+
for i, example in enumerate(np.split(inputs_copy, indices_or_sections=new_inputs.shape[0], axis=0)):
|
139 |
+
new_example = example[0][~to_remove[i]]
|
140 |
+
new_inputs[i, 0 : new_example.shape[0]] = new_example
|
141 |
+
|
142 |
+
# batching now fixed
|
143 |
+
return new_inputs.tolist(), labels.tolist()
|
144 |
+
|
145 |
+
|
146 |
+
# Code below is by Matt Bui
|
147 |
+
@dataclass
|
148 |
+
class SentenceTokenize:
|
149 |
+
"""Tokenize documents into sentences, add bos and eos tokens and split sentences into smaller chunks if too long."""
|
150 |
+
|
151 |
+
sentence_tokenizer = nltk.data.load("tokenizers/punkt/english.pickle")
|
152 |
+
bos: str = "<s>"
|
153 |
+
eos: str = "</s>"
|
154 |
+
max_sentences = 256
|
155 |
+
sentence_stride = 128
|
156 |
+
max_characters = 100000
|
157 |
+
|
158 |
+
def __call__(self, examples: Dict[str, List[str]]) -> Dict[str, List[str]]:
|
159 |
+
is_batched = isinstance(examples["text"], list)
|
160 |
+
if not is_batched:
|
161 |
+
# raise ValueError("required batched=True in map() method")
|
162 |
+
examples["text"] = [examples["text"]]
|
163 |
+
|
164 |
+
texts = []
|
165 |
+
# print(f"len(examples['text'] : {len(examples['text'])}")
|
166 |
+
for doc in examples["text"]:
|
167 |
+
sentences = self.sentence_tokenizer.tokenize(doc)
|
168 |
+
start_index = 0
|
169 |
+
# print(f"doc len: {len(doc)}")
|
170 |
+
# print(f"sent_tok len: {len(sentences)}")
|
171 |
+
while start_index < len(sentences):
|
172 |
+
sentence_span = sentences[start_index : min(len(sentences), start_index + self.max_sentences)]
|
173 |
+
text = f"{self.eos}{self.bos}".join([sentence for sentence in sentence_span])
|
174 |
+
|
175 |
+
# trim text by max characters
|
176 |
+
if len(text) > self.max_characters:
|
177 |
+
text = text[: self.max_characters]
|
178 |
+
texts.append(text)
|
179 |
+
start_index += self.sentence_stride
|
180 |
+
# print(len(texts))
|
181 |
+
# print()
|
182 |
+
return {"text": texts}
|
183 |
+
|
184 |
+
|
185 |
+
@dataclass
|
186 |
+
class DataCollatorForSentencePermutation:
|
187 |
+
tokenizer: PreTrainedTokenizerBase
|
188 |
+
permutate_sentence_ratio: float = 1.0
|
189 |
+
|
190 |
+
def __post_init__(self):
|
191 |
+
self.full_stop_index = self.tokenizer.eos_token_id
|
192 |
+
|
193 |
+
def __call__(self, example: Dict[str, np.ndarray]) -> Dict[str, np.ndarray]:
|
194 |
+
source = example["input_ids"]
|
195 |
+
|
196 |
+
full_stops = source == self.full_stop_index
|
197 |
+
|
198 |
+
# Tokens that are full stops, where the previous token is not
|
199 |
+
sentence_ends = (full_stops[1:] * ~full_stops[:-1]).nonzero()[0] + 2
|
200 |
+
result = source.copy()
|
201 |
+
|
202 |
+
num_sentences = jnp.size(sentence_ends, 0)
|
203 |
+
num_to_permute = math.ceil((num_sentences * 2 * self.permutate_sentence_ratio) / 2.0)
|
204 |
+
substitutions = random.permutation(self.random_key, num_sentences)[:num_to_permute]
|
205 |
+
ordering = jnp.arange(0, num_sentences)
|
206 |
+
ordering = ops.index_update(
|
207 |
+
ordering, substitutions, substitutions[random.permutation(self.random_key, num_to_permute)]
|
208 |
+
)
|
209 |
+
|
210 |
+
index = 0
|
211 |
+
for i in ordering:
|
212 |
+
sentence = source[(sentence_ends[i - 1] if i > 0 else 0) : sentence_ends[i]]
|
213 |
+
result = ops.index_update(result, ops.index[index : index + jnp.size(sentence, 0)], sentence)
|
214 |
+
index += jnp.size(sentence, 0)
|
215 |
+
|
216 |
+
example["decoder_input_ids"] = example["input_ids"]
|
217 |
+
example["input_ids"] = result
|
218 |
+
|
219 |
+
return example
|
220 |
+
|
221 |
+
|
222 |
+
@dataclass
|
223 |
+
class DataCollatorForDenoisingTasks:
|
224 |
+
"""Data collator used denoising language modeling task in BART.
|
225 |
+
The implementation is based on
|
226 |
+
https://github.com/pytorch/fairseq/blob/1bba712622b8ae4efb3eb793a8a40da386fe11d0/fairseq/data/denoising_dataset.py.
|
227 |
+
The default paramters is based on BART paper https://arxiv.org/abs/1910.13461.
|
228 |
+
"""
|
229 |
+
|
230 |
+
tokenizer: PreTrainedTokenizerBase
|
231 |
+
mask_ratio: float = 0.3
|
232 |
+
poisson_lambda: float = 3.0
|
233 |
+
permutate_sentence_ratio: float = 1.0
|
234 |
+
pad_to_multiple_of: int = 16
|
235 |
+
|
236 |
+
def __post_init__(self):
|
237 |
+
if self.tokenizer.mask_token is None or self.tokenizer.eos_token is None:
|
238 |
+
raise ValueError
|
239 |
+
|
240 |
+
def __call__(self, examples: List[Dict[str, List[int]]]) -> Dict[str, np.ndarray]:
|
241 |
+
"""Batching, adding whole word mask and permutate sentences
|
242 |
+
Args:
|
243 |
+
examples (dict): list of examples each examples contains input_ids field
|
244 |
+
"""
|
245 |
+
# Handle dict or lists with proper padding and conversion to tensor.
|
246 |
+
batch = self.tokenizer.pad(examples, pad_to_multiple_of=self.pad_to_multiple_of, return_tensors="np")
|
247 |
+
batch["decoder_input_ids"] = self.shift_tokens_right(batch["input_ids"])
|
248 |
+
|
249 |
+
do_permutate = False
|
250 |
+
if self.permutate_sentence_ratio > 0.0:
|
251 |
+
batch["input_ids"] = self.permutate_sentences(batch["input_ids"])
|
252 |
+
do_permutate = True
|
253 |
+
|
254 |
+
if self.mask_ratio:
|
255 |
+
batch["input_ids"], batch["labels"] = self.add_whole_word_mask(batch["input_ids"], do_permutate)
|
256 |
+
|
257 |
+
return batch
|
258 |
+
|
259 |
+
def shift_tokens_right(self, inputs):
|
260 |
+
"""Shift decoder input ids right: https://github.com/huggingface/transformers/issues/7961.
|
261 |
+
Examples:
|
262 |
+
<s>My dog is cute.</s><s>It loves to play in the park.</s><pad><pad>
|
263 |
+
shift to -> </s><s>My dog is cute.</s><s>It loves to play in the park.<pad><pad>
|
264 |
+
"""
|
265 |
+
|
266 |
+
shifted_inputs = np.roll(inputs, 1, axis=-1)
|
267 |
+
|
268 |
+
# replace first token with eos token
|
269 |
+
shifted_inputs[:, 0] = self.tokenizer.eos_token_id
|
270 |
+
|
271 |
+
# when there's padding, the last eos tokens will not be rotate to first positon
|
272 |
+
# we'll need to replace it with a padding token
|
273 |
+
|
274 |
+
# replace eos tokens at the end of sequences with pad tokens
|
275 |
+
end_with_eos = np.where(shifted_inputs[:, -1] == self.tokenizer.eos_token_id)
|
276 |
+
shifted_inputs[end_with_eos, -1] = self.tokenizer.pad_token_id
|
277 |
+
|
278 |
+
# find positions where where's the token is eos and its follwing token is a padding token
|
279 |
+
last_eos_indices = np.where(
|
280 |
+
(shifted_inputs[:, :-1] == self.tokenizer.eos_token_id)
|
281 |
+
* (shifted_inputs[:, 1:] == self.tokenizer.pad_token_id)
|
282 |
+
)
|
283 |
+
|
284 |
+
# replace eos tokens with pad token
|
285 |
+
shifted_inputs[last_eos_indices] = self.tokenizer.pad_token_id
|
286 |
+
return shifted_inputs
|
287 |
+
|
288 |
+
def permutate_sentences(self, inputs):
|
289 |
+
results = inputs.copy()
|
290 |
+
|
291 |
+
full_stops = inputs == self.tokenizer.eos_token_id
|
292 |
+
|
293 |
+
sentence_ends = np.argwhere(full_stops[:, 1:] * ~full_stops[:, :-1])
|
294 |
+
sentence_ends[:, 1] += 2
|
295 |
+
num_sentences = np.unique(sentence_ends[:, 0], return_counts=True)[1]
|
296 |
+
num_to_permute = np.ceil((num_sentences * 2 * self.permutate_sentence_ratio) / 2.0).astype(int)
|
297 |
+
|
298 |
+
sentence_ends = np.split(sentence_ends[:, 1], np.unique(sentence_ends[:, 0], return_index=True)[1][1:])
|
299 |
+
|
300 |
+
for i in range(inputs.shape[0]):
|
301 |
+
substitutions = np.random.permutation(num_sentences[i])[: num_to_permute[i]]
|
302 |
+
|
303 |
+
ordering = np.arange(0, num_sentences[i])
|
304 |
+
ordering[substitutions] = substitutions[np.random.permutation(num_to_permute[i])]
|
305 |
+
|
306 |
+
index = 0
|
307 |
+
for j in ordering:
|
308 |
+
sentence = inputs[i, (sentence_ends[i][j - 1] if j > 0 else 0) : sentence_ends[i][j]]
|
309 |
+
results[i, index : index + sentence.shape[0]] = sentence
|
310 |
+
index += sentence.shape[0]
|
311 |
+
return results
|
312 |
+
|
313 |
+
def add_whole_word_mask(self, inputs, do_permutate):
|
314 |
+
labels = inputs.copy()
|
315 |
+
|
316 |
+
special_tokens_mask = [
|
317 |
+
self.tokenizer.get_special_tokens_mask(val, already_has_special_tokens=True) for val in labels.tolist()
|
318 |
+
]
|
319 |
+
special_tokens_mask = np.array(special_tokens_mask, dtype=bool)
|
320 |
+
|
321 |
+
# determine how many tokens we need to mask in total
|
322 |
+
is_token = ~(labels == self.tokenizer.pad_token_id) & ~special_tokens_mask
|
323 |
+
num_to_mask = int(math.ceil(is_token.astype(float).sum() * self.mask_ratio))
|
324 |
+
if num_to_mask == 0:
|
325 |
+
return inputs, labels
|
326 |
+
|
327 |
+
# generate a sufficient number of span lengths
|
328 |
+
lengths = poisson(lam=self.poisson_lambda, size=(num_to_mask,))
|
329 |
+
while np.cumsum(lengths, 0)[-1] < num_to_mask:
|
330 |
+
lengths = np.concatenate([lengths, poisson(lam=self.poisson_lambda, size=(num_to_mask,))])
|
331 |
+
|
332 |
+
# remove all spans of length 0
|
333 |
+
# Note that BART inserts additional mask tokens where length == 0,
|
334 |
+
# which we do not implement for now as it adds additional complexity
|
335 |
+
lengths = lengths[lengths > 0]
|
336 |
+
|
337 |
+
# trim to about num_to_mask tokens
|
338 |
+
idx = np.argmin(np.abs(np.cumsum(lengths, 0) - num_to_mask)) + 1
|
339 |
+
lengths = lengths[: idx + 1]
|
340 |
+
|
341 |
+
# select span start indices
|
342 |
+
# print("IS TOKEN")
|
343 |
+
# print(is_token)
|
344 |
+
# print(sum(list(map(lambda x: 1 if(x) else 0, is_token[0]))))
|
345 |
+
token_indices = np.argwhere(is_token == 1)
|
346 |
+
# print("TOKEN INDICES")
|
347 |
+
# print(token_indices)
|
348 |
+
span_starts = permutation(token_indices.shape[0])[: lengths.shape[0]]
|
349 |
+
|
350 |
+
# prepare mask
|
351 |
+
masked_indices = np.array(token_indices[span_starts])
|
352 |
+
# print("MASKED INDICES")
|
353 |
+
# print(masked_indices)
|
354 |
+
mask = np.full_like(labels, fill_value=False)
|
355 |
+
|
356 |
+
# mask span start indices
|
357 |
+
for mi in masked_indices:
|
358 |
+
mask[tuple(mi)] = True
|
359 |
+
lengths -= 1
|
360 |
+
|
361 |
+
# fill up spans
|
362 |
+
max_index = labels.shape[1] - 1
|
363 |
+
remaining = (lengths > 0) & (masked_indices[:, 1] < max_index)
|
364 |
+
while np.any(remaining):
|
365 |
+
masked_indices[remaining, 1] += 1
|
366 |
+
for mi in masked_indices:
|
367 |
+
mask[tuple(mi)] = True
|
368 |
+
lengths -= 1
|
369 |
+
remaining = (lengths > 0) & (masked_indices[:, 1] < max_index)
|
370 |
+
|
371 |
+
# place the mask tokens
|
372 |
+
mask[np.where(special_tokens_mask)] = False
|
373 |
+
inputs[np.where(mask)] = self.tokenizer.mask_token_id
|
374 |
+
|
375 |
+
if not do_permutate:
|
376 |
+
labels[np.where(mask)] = -100
|
377 |
+
else:
|
378 |
+
labels[np.where(special_tokens_mask)] = -100
|
379 |
+
|
380 |
+
# remove mask tokens that are not starts of spans
|
381 |
+
to_remove = (mask == 1) & np.roll((mask == 1), 1, 1)
|
382 |
+
new_inputs = np.full_like(labels, fill_value=self.tokenizer.pad_token_id)
|
383 |
+
|
384 |
+
# splits = list(map(lambda x: x.reshape(-1), np.split(inputs_copy, indices_or_sections=2, axis=0))
|
385 |
+
for i, example in enumerate(np.split(inputs, indices_or_sections=new_inputs.shape[0], axis=0)):
|
386 |
+
new_example = example[0][~to_remove[i]]
|
387 |
+
new_inputs[i, 0 : new_example.shape[0]] = new_example
|
388 |
+
|
389 |
+
# batching now fixed
|
390 |
+
return new_inputs, labels
|
jax_env/bin/Activate.ps1
ADDED
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<#
|
2 |
+
.Synopsis
|
3 |
+
Activate a Python virtual environment for the current PowerShell session.
|
4 |
+
|
5 |
+
.Description
|
6 |
+
Pushes the python executable for a virtual environment to the front of the
|
7 |
+
$Env:PATH environment variable and sets the prompt to signify that you are
|
8 |
+
in a Python virtual environment. Makes use of the command line switches as
|
9 |
+
well as the `pyvenv.cfg` file values present in the virtual environment.
|
10 |
+
|
11 |
+
.Parameter VenvDir
|
12 |
+
Path to the directory that contains the virtual environment to activate. The
|
13 |
+
default value for this is the parent of the directory that the Activate.ps1
|
14 |
+
script is located within.
|
15 |
+
|
16 |
+
.Parameter Prompt
|
17 |
+
The prompt prefix to display when this virtual environment is activated. By
|
18 |
+
default, this prompt is the name of the virtual environment folder (VenvDir)
|
19 |
+
surrounded by parentheses and followed by a single space (ie. '(.venv) ').
|
20 |
+
|
21 |
+
.Example
|
22 |
+
Activate.ps1
|
23 |
+
Activates the Python virtual environment that contains the Activate.ps1 script.
|
24 |
+
|
25 |
+
.Example
|
26 |
+
Activate.ps1 -Verbose
|
27 |
+
Activates the Python virtual environment that contains the Activate.ps1 script,
|
28 |
+
and shows extra information about the activation as it executes.
|
29 |
+
|
30 |
+
.Example
|
31 |
+
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
|
32 |
+
Activates the Python virtual environment located in the specified location.
|
33 |
+
|
34 |
+
.Example
|
35 |
+
Activate.ps1 -Prompt "MyPython"
|
36 |
+
Activates the Python virtual environment that contains the Activate.ps1 script,
|
37 |
+
and prefixes the current prompt with the specified string (surrounded in
|
38 |
+
parentheses) while the virtual environment is active.
|
39 |
+
|
40 |
+
.Notes
|
41 |
+
On Windows, it may be required to enable this Activate.ps1 script by setting the
|
42 |
+
execution policy for the user. You can do this by issuing the following PowerShell
|
43 |
+
command:
|
44 |
+
|
45 |
+
PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
46 |
+
|
47 |
+
For more information on Execution Policies:
|
48 |
+
https://go.microsoft.com/fwlink/?LinkID=135170
|
49 |
+
|
50 |
+
#>
|
51 |
+
Param(
|
52 |
+
[Parameter(Mandatory = $false)]
|
53 |
+
[String]
|
54 |
+
$VenvDir,
|
55 |
+
[Parameter(Mandatory = $false)]
|
56 |
+
[String]
|
57 |
+
$Prompt
|
58 |
+
)
|
59 |
+
|
60 |
+
<# Function declarations --------------------------------------------------- #>
|
61 |
+
|
62 |
+
<#
|
63 |
+
.Synopsis
|
64 |
+
Remove all shell session elements added by the Activate script, including the
|
65 |
+
addition of the virtual environment's Python executable from the beginning of
|
66 |
+
the PATH variable.
|
67 |
+
|
68 |
+
.Parameter NonDestructive
|
69 |
+
If present, do not remove this function from the global namespace for the
|
70 |
+
session.
|
71 |
+
|
72 |
+
#>
|
73 |
+
function global:deactivate ([switch]$NonDestructive) {
|
74 |
+
# Revert to original values
|
75 |
+
|
76 |
+
# The prior prompt:
|
77 |
+
if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
|
78 |
+
Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
|
79 |
+
Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
|
80 |
+
}
|
81 |
+
|
82 |
+
# The prior PYTHONHOME:
|
83 |
+
if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
|
84 |
+
Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
|
85 |
+
Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
|
86 |
+
}
|
87 |
+
|
88 |
+
# The prior PATH:
|
89 |
+
if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
|
90 |
+
Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
|
91 |
+
Remove-Item -Path Env:_OLD_VIRTUAL_PATH
|
92 |
+
}
|
93 |
+
|
94 |
+
# Just remove the VIRTUAL_ENV altogether:
|
95 |
+
if (Test-Path -Path Env:VIRTUAL_ENV) {
|
96 |
+
Remove-Item -Path env:VIRTUAL_ENV
|
97 |
+
}
|
98 |
+
|
99 |
+
# Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
|
100 |
+
if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
|
101 |
+
Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
|
102 |
+
}
|
103 |
+
|
104 |
+
# Leave deactivate function in the global namespace if requested:
|
105 |
+
if (-not $NonDestructive) {
|
106 |
+
Remove-Item -Path function:deactivate
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
<#
|
111 |
+
.Description
|
112 |
+
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
|
113 |
+
given folder, and returns them in a map.
|
114 |
+
|
115 |
+
For each line in the pyvenv.cfg file, if that line can be parsed into exactly
|
116 |
+
two strings separated by `=` (with any amount of whitespace surrounding the =)
|
117 |
+
then it is considered a `key = value` line. The left hand string is the key,
|
118 |
+
the right hand is the value.
|
119 |
+
|
120 |
+
If the value starts with a `'` or a `"` then the first and last character is
|
121 |
+
stripped from the value before being captured.
|
122 |
+
|
123 |
+
.Parameter ConfigDir
|
124 |
+
Path to the directory that contains the `pyvenv.cfg` file.
|
125 |
+
#>
|
126 |
+
function Get-PyVenvConfig(
|
127 |
+
[String]
|
128 |
+
$ConfigDir
|
129 |
+
) {
|
130 |
+
Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"
|
131 |
+
|
132 |
+
# Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
|
133 |
+
$pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue
|
134 |
+
|
135 |
+
# An empty map will be returned if no config file is found.
|
136 |
+
$pyvenvConfig = @{ }
|
137 |
+
|
138 |
+
if ($pyvenvConfigPath) {
|
139 |
+
|
140 |
+
Write-Verbose "File exists, parse `key = value` lines"
|
141 |
+
$pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath
|
142 |
+
|
143 |
+
$pyvenvConfigContent | ForEach-Object {
|
144 |
+
$keyval = $PSItem -split "\s*=\s*", 2
|
145 |
+
if ($keyval[0] -and $keyval[1]) {
|
146 |
+
$val = $keyval[1]
|
147 |
+
|
148 |
+
# Remove extraneous quotations around a string value.
|
149 |
+
if ("'""".Contains($val.Substring(0, 1))) {
|
150 |
+
$val = $val.Substring(1, $val.Length - 2)
|
151 |
+
}
|
152 |
+
|
153 |
+
$pyvenvConfig[$keyval[0]] = $val
|
154 |
+
Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
|
155 |
+
}
|
156 |
+
}
|
157 |
+
}
|
158 |
+
return $pyvenvConfig
|
159 |
+
}
|
160 |
+
|
161 |
+
|
162 |
+
<# Begin Activate script --------------------------------------------------- #>
|
163 |
+
|
164 |
+
# Determine the containing directory of this script
|
165 |
+
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
|
166 |
+
$VenvExecDir = Get-Item -Path $VenvExecPath
|
167 |
+
|
168 |
+
Write-Verbose "Activation script is located in path: '$VenvExecPath'"
|
169 |
+
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
|
170 |
+
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"
|
171 |
+
|
172 |
+
# Set values required in priority: CmdLine, ConfigFile, Default
|
173 |
+
# First, get the location of the virtual environment, it might not be
|
174 |
+
# VenvExecDir if specified on the command line.
|
175 |
+
if ($VenvDir) {
|
176 |
+
Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
|
177 |
+
}
|
178 |
+
else {
|
179 |
+
Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
|
180 |
+
$VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
|
181 |
+
Write-Verbose "VenvDir=$VenvDir"
|
182 |
+
}
|
183 |
+
|
184 |
+
# Next, read the `pyvenv.cfg` file to determine any required value such
|
185 |
+
# as `prompt`.
|
186 |
+
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir
|
187 |
+
|
188 |
+
# Next, set the prompt from the command line, or the config file, or
|
189 |
+
# just use the name of the virtual environment folder.
|
190 |
+
if ($Prompt) {
|
191 |
+
Write-Verbose "Prompt specified as argument, using '$Prompt'"
|
192 |
+
}
|
193 |
+
else {
|
194 |
+
Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
|
195 |
+
if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
|
196 |
+
Write-Verbose " Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
|
197 |
+
$Prompt = $pyvenvCfg['prompt'];
|
198 |
+
}
|
199 |
+
else {
|
200 |
+
Write-Verbose " Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virutal environment)"
|
201 |
+
Write-Verbose " Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
|
202 |
+
$Prompt = Split-Path -Path $venvDir -Leaf
|
203 |
+
}
|
204 |
+
}
|
205 |
+
|
206 |
+
Write-Verbose "Prompt = '$Prompt'"
|
207 |
+
Write-Verbose "VenvDir='$VenvDir'"
|
208 |
+
|
209 |
+
# Deactivate any currently active virtual environment, but leave the
|
210 |
+
# deactivate function in place.
|
211 |
+
deactivate -nondestructive
|
212 |
+
|
213 |
+
# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
|
214 |
+
# that there is an activated venv.
|
215 |
+
$env:VIRTUAL_ENV = $VenvDir
|
216 |
+
|
217 |
+
if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {
|
218 |
+
|
219 |
+
Write-Verbose "Setting prompt to '$Prompt'"
|
220 |
+
|
221 |
+
# Set the prompt to include the env name
|
222 |
+
# Make sure _OLD_VIRTUAL_PROMPT is global
|
223 |
+
function global:_OLD_VIRTUAL_PROMPT { "" }
|
224 |
+
Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
|
225 |
+
New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt
|
226 |
+
|
227 |
+
function global:prompt {
|
228 |
+
Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
|
229 |
+
_OLD_VIRTUAL_PROMPT
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
# Clear PYTHONHOME
|
234 |
+
if (Test-Path -Path Env:PYTHONHOME) {
|
235 |
+
Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
|
236 |
+
Remove-Item -Path Env:PYTHONHOME
|
237 |
+
}
|
238 |
+
|
239 |
+
# Add the venv to the PATH
|
240 |
+
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
|
241 |
+
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
|
jax_env/bin/activate
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file must be used with "source bin/activate" *from bash*
|
2 |
+
# you cannot run it directly
|
3 |
+
|
4 |
+
deactivate () {
|
5 |
+
# reset old environment variables
|
6 |
+
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
|
7 |
+
PATH="${_OLD_VIRTUAL_PATH:-}"
|
8 |
+
export PATH
|
9 |
+
unset _OLD_VIRTUAL_PATH
|
10 |
+
fi
|
11 |
+
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
|
12 |
+
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
|
13 |
+
export PYTHONHOME
|
14 |
+
unset _OLD_VIRTUAL_PYTHONHOME
|
15 |
+
fi
|
16 |
+
|
17 |
+
# This should detect bash and zsh, which have a hash command that must
|
18 |
+
# be called to get it to forget past commands. Without forgetting
|
19 |
+
# past commands the $PATH changes we made may not be respected
|
20 |
+
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
|
21 |
+
hash -r
|
22 |
+
fi
|
23 |
+
|
24 |
+
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
|
25 |
+
PS1="${_OLD_VIRTUAL_PS1:-}"
|
26 |
+
export PS1
|
27 |
+
unset _OLD_VIRTUAL_PS1
|
28 |
+
fi
|
29 |
+
|
30 |
+
unset VIRTUAL_ENV
|
31 |
+
if [ ! "${1:-}" = "nondestructive" ] ; then
|
32 |
+
# Self destruct!
|
33 |
+
unset -f deactivate
|
34 |
+
fi
|
35 |
+
}
|
36 |
+
|
37 |
+
# unset irrelevant variables
|
38 |
+
deactivate nondestructive
|
39 |
+
|
40 |
+
VIRTUAL_ENV="/mnt/disks/flaxdisk/flax-bart-nb-nn/jax_env"
|
41 |
+
export VIRTUAL_ENV
|
42 |
+
|
43 |
+
_OLD_VIRTUAL_PATH="$PATH"
|
44 |
+
PATH="$VIRTUAL_ENV/bin:$PATH"
|
45 |
+
export PATH
|
46 |
+
|
47 |
+
# unset PYTHONHOME if set
|
48 |
+
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
|
49 |
+
# could use `if (set -u; : $PYTHONHOME) ;` in bash
|
50 |
+
if [ -n "${PYTHONHOME:-}" ] ; then
|
51 |
+
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
|
52 |
+
unset PYTHONHOME
|
53 |
+
fi
|
54 |
+
|
55 |
+
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
|
56 |
+
_OLD_VIRTUAL_PS1="${PS1:-}"
|
57 |
+
if [ "x(jax_env) " != x ] ; then
|
58 |
+
PS1="(jax_env) ${PS1:-}"
|
59 |
+
else
|
60 |
+
if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
|
61 |
+
# special case for Aspen magic directories
|
62 |
+
# see https://aspen.io/
|
63 |
+
PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
|
64 |
+
else
|
65 |
+
PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
|
66 |
+
fi
|
67 |
+
fi
|
68 |
+
export PS1
|
69 |
+
fi
|
70 |
+
|
71 |
+
# This should detect bash and zsh, which have a hash command that must
|
72 |
+
# be called to get it to forget past commands. Without forgetting
|
73 |
+
# past commands the $PATH changes we made may not be respected
|
74 |
+
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
|
75 |
+
hash -r
|
76 |
+
fi
|
jax_env/bin/activate.csh
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file must be used with "source bin/activate.csh" *from csh*.
|
2 |
+
# You cannot run it directly.
|
3 |
+
# Created by Davide Di Blasi <davidedb@gmail.com>.
|
4 |
+
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
|
5 |
+
|
6 |
+
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
|
7 |
+
|
8 |
+
# Unset irrelevant variables.
|
9 |
+
deactivate nondestructive
|
10 |
+
|
11 |
+
setenv VIRTUAL_ENV "/mnt/disks/flaxdisk/flax-bart-nb-nn/jax_env"
|
12 |
+
|
13 |
+
set _OLD_VIRTUAL_PATH="$PATH"
|
14 |
+
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
|
15 |
+
|
16 |
+
|
17 |
+
set _OLD_VIRTUAL_PROMPT="$prompt"
|
18 |
+
|
19 |
+
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
|
20 |
+
if ("jax_env" != "") then
|
21 |
+
set env_name = "jax_env"
|
22 |
+
else
|
23 |
+
if (`basename "VIRTUAL_ENV"` == "__") then
|
24 |
+
# special case for Aspen magic directories
|
25 |
+
# see https://aspen.io/
|
26 |
+
set env_name = `basename \`dirname "$VIRTUAL_ENV"\``
|
27 |
+
else
|
28 |
+
set env_name = `basename "$VIRTUAL_ENV"`
|
29 |
+
endif
|
30 |
+
endif
|
31 |
+
set prompt = "[$env_name] $prompt"
|
32 |
+
unset env_name
|
33 |
+
endif
|
34 |
+
|
35 |
+
alias pydoc python -m pydoc
|
36 |
+
|
37 |
+
rehash
|
jax_env/bin/activate.fish
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org)
|
2 |
+
# you cannot run it directly
|
3 |
+
|
4 |
+
function deactivate -d "Exit virtualenv and return to normal shell environment"
|
5 |
+
# reset old environment variables
|
6 |
+
if test -n "$_OLD_VIRTUAL_PATH"
|
7 |
+
set -gx PATH $_OLD_VIRTUAL_PATH
|
8 |
+
set -e _OLD_VIRTUAL_PATH
|
9 |
+
end
|
10 |
+
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
|
11 |
+
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
|
12 |
+
set -e _OLD_VIRTUAL_PYTHONHOME
|
13 |
+
end
|
14 |
+
|
15 |
+
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
|
16 |
+
functions -e fish_prompt
|
17 |
+
set -e _OLD_FISH_PROMPT_OVERRIDE
|
18 |
+
functions -c _old_fish_prompt fish_prompt
|
19 |
+
functions -e _old_fish_prompt
|
20 |
+
end
|
21 |
+
|
22 |
+
set -e VIRTUAL_ENV
|
23 |
+
if test "$argv[1]" != "nondestructive"
|
24 |
+
# Self destruct!
|
25 |
+
functions -e deactivate
|
26 |
+
end
|
27 |
+
end
|
28 |
+
|
29 |
+
# unset irrelevant variables
|
30 |
+
deactivate nondestructive
|
31 |
+
|
32 |
+
set -gx VIRTUAL_ENV "/mnt/disks/flaxdisk/flax-bart-nb-nn/jax_env"
|
33 |
+
|
34 |
+
set -gx _OLD_VIRTUAL_PATH $PATH
|
35 |
+
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
|
36 |
+
|
37 |
+
# unset PYTHONHOME if set
|
38 |
+
if set -q PYTHONHOME
|
39 |
+
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
|
40 |
+
set -e PYTHONHOME
|
41 |
+
end
|
42 |
+
|
43 |
+
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
|
44 |
+
# fish uses a function instead of an env var to generate the prompt.
|
45 |
+
|
46 |
+
# save the current fish_prompt function as the function _old_fish_prompt
|
47 |
+
functions -c fish_prompt _old_fish_prompt
|
48 |
+
|
49 |
+
# with the original prompt function renamed, we can override with our own.
|
50 |
+
function fish_prompt
|
51 |
+
# Save the return status of the last command
|
52 |
+
set -l old_status $status
|
53 |
+
|
54 |
+
# Prompt override?
|
55 |
+
if test -n "(jax_env) "
|
56 |
+
printf "%s%s" "(jax_env) " (set_color normal)
|
57 |
+
else
|
58 |
+
# ...Otherwise, prepend env
|
59 |
+
set -l _checkbase (basename "$VIRTUAL_ENV")
|
60 |
+
if test $_checkbase = "__"
|
61 |
+
# special case for Aspen magic directories
|
62 |
+
# see https://aspen.io/
|
63 |
+
printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal)
|
64 |
+
else
|
65 |
+
printf "%s(%s)%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal)
|
66 |
+
end
|
67 |
+
end
|
68 |
+
|
69 |
+
# Restore the return status of the previous command.
|
70 |
+
echo "exit $old_status" | .
|
71 |
+
_old_fish_prompt
|
72 |
+
end
|
73 |
+
|
74 |
+
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
|
75 |
+
end
|
jax_env/bin/easy_install
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/mnt/disks/flaxdisk/flax-bart-nb-nn/jax_env/bin/python3
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from setuptools.command.easy_install import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
jax_env/bin/easy_install-3.8
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/mnt/disks/flaxdisk/flax-bart-nb-nn/jax_env/bin/python3
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from setuptools.command.easy_install import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
jax_env/bin/pip
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/mnt/disks/flaxdisk/flax-bart-nb-nn/jax_env/bin/python3
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from pip._internal.cli.main import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
jax_env/bin/pip3
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/mnt/disks/flaxdisk/flax-bart-nb-nn/jax_env/bin/python3
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from pip._internal.cli.main import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
jax_env/bin/pip3.8
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/mnt/disks/flaxdisk/flax-bart-nb-nn/jax_env/bin/python3
|
2 |
+
# -*- coding: utf-8 -*-
|
3 |
+
import re
|
4 |
+
import sys
|
5 |
+
from pip._internal.cli.main import main
|
6 |
+
if __name__ == '__main__':
|
7 |
+
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])
|
8 |
+
sys.exit(main())
|
jax_env/bin/python
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
python3
|
jax_env/bin/python3
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
/home/perk/flax/bin/python3
|
jax_env/lib/python3.8/site-packages/__pycache__/easy_install.cpython-38.pyc
ADDED
Binary file (281 Bytes). View file
|
|
jax_env/lib/python3.8/site-packages/easy_install.py
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Run the EasyInstall command"""
|
2 |
+
|
3 |
+
if __name__ == '__main__':
|
4 |
+
from setuptools.command.easy_install import main
|
5 |
+
main()
|
jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/INSTALLER
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (c) 2008-2019 The pip developers (see AUTHORS.txt file)
|
2 |
+
|
3 |
+
Permission is hereby granted, free of charge, to any person obtaining
|
4 |
+
a copy of this software and associated documentation files (the
|
5 |
+
"Software"), to deal in the Software without restriction, including
|
6 |
+
without limitation the rights to use, copy, modify, merge, publish,
|
7 |
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8 |
+
permit persons to whom the Software is furnished to do so, subject to
|
9 |
+
the following conditions:
|
10 |
+
|
11 |
+
The above copyright notice and this permission notice shall be
|
12 |
+
included in all copies or substantial portions of the Software.
|
13 |
+
|
14 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15 |
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16 |
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17 |
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18 |
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19 |
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20 |
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/METADATA
ADDED
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Metadata-Version: 2.1
|
2 |
+
Name: pip
|
3 |
+
Version: 20.0.2
|
4 |
+
Summary: The PyPA recommended tool for installing Python packages.
|
5 |
+
Home-page: https://pip.pypa.io/
|
6 |
+
Author: The pip developers
|
7 |
+
Author-email: pypa-dev@groups.google.com
|
8 |
+
License: MIT
|
9 |
+
Project-URL: Documentation, https://pip.pypa.io
|
10 |
+
Project-URL: Source, https://github.com/pypa/pip
|
11 |
+
Keywords: distutils easy_install egg setuptools wheel virtualenv
|
12 |
+
Platform: UNKNOWN
|
13 |
+
Classifier: Development Status :: 5 - Production/Stable
|
14 |
+
Classifier: Intended Audience :: Developers
|
15 |
+
Classifier: License :: OSI Approved :: MIT License
|
16 |
+
Classifier: Topic :: Software Development :: Build Tools
|
17 |
+
Classifier: Programming Language :: Python
|
18 |
+
Classifier: Programming Language :: Python :: 2
|
19 |
+
Classifier: Programming Language :: Python :: 2.7
|
20 |
+
Classifier: Programming Language :: Python :: 3
|
21 |
+
Classifier: Programming Language :: Python :: 3.5
|
22 |
+
Classifier: Programming Language :: Python :: 3.6
|
23 |
+
Classifier: Programming Language :: Python :: 3.7
|
24 |
+
Classifier: Programming Language :: Python :: 3.8
|
25 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
26 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
27 |
+
Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
|
28 |
+
|
29 |
+
pip - The Python Package Installer
|
30 |
+
==================================
|
31 |
+
|
32 |
+
.. image:: https://img.shields.io/pypi/v/pip.svg
|
33 |
+
:target: https://pypi.org/project/pip/
|
34 |
+
|
35 |
+
.. image:: https://readthedocs.org/projects/pip/badge/?version=latest
|
36 |
+
:target: https://pip.pypa.io/en/latest
|
37 |
+
|
38 |
+
pip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.
|
39 |
+
|
40 |
+
Please take a look at our documentation for how to install and use pip:
|
41 |
+
|
42 |
+
* `Installation`_
|
43 |
+
* `Usage`_
|
44 |
+
|
45 |
+
Updates are released regularly, with a new version every 3 months. More details can be found in our documentation:
|
46 |
+
|
47 |
+
* `Release notes`_
|
48 |
+
* `Release process`_
|
49 |
+
|
50 |
+
If you find bugs, need help, or want to talk to the developers please use our mailing lists or chat rooms:
|
51 |
+
|
52 |
+
* `Issue tracking`_
|
53 |
+
* `Discourse channel`_
|
54 |
+
* `User IRC`_
|
55 |
+
|
56 |
+
If you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:
|
57 |
+
|
58 |
+
* `GitHub page`_
|
59 |
+
* `Dev documentation`_
|
60 |
+
* `Dev mailing list`_
|
61 |
+
* `Dev IRC`_
|
62 |
+
|
63 |
+
Code of Conduct
|
64 |
+
---------------
|
65 |
+
|
66 |
+
Everyone interacting in the pip project's codebases, issue trackers, chat
|
67 |
+
rooms, and mailing lists is expected to follow the `PyPA Code of Conduct`_.
|
68 |
+
|
69 |
+
.. _package installer: https://packaging.python.org/guides/tool-recommendations/
|
70 |
+
.. _Python Package Index: https://pypi.org
|
71 |
+
.. _Installation: https://pip.pypa.io/en/stable/installing.html
|
72 |
+
.. _Usage: https://pip.pypa.io/en/stable/
|
73 |
+
.. _Release notes: https://pip.pypa.io/en/stable/news.html
|
74 |
+
.. _Release process: https://pip.pypa.io/en/latest/development/release-process/
|
75 |
+
.. _GitHub page: https://github.com/pypa/pip
|
76 |
+
.. _Dev documentation: https://pip.pypa.io/en/latest/development
|
77 |
+
.. _Issue tracking: https://github.com/pypa/pip/issues
|
78 |
+
.. _Discourse channel: https://discuss.python.org/c/packaging
|
79 |
+
.. _Dev mailing list: https://groups.google.com/forum/#!forum/pypa-dev
|
80 |
+
.. _User IRC: https://webchat.freenode.net/?channels=%23pypa
|
81 |
+
.. _Dev IRC: https://webchat.freenode.net/?channels=%23pypa-dev
|
82 |
+
.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/
|
83 |
+
|
84 |
+
|
jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/RECORD
ADDED
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
../../../bin/pip,sha256=nMap_ot4S8UAEm2gA4OPEAOScwhi8NyPH6ggEPV0af8,260
|
2 |
+
../../../bin/pip3,sha256=nMap_ot4S8UAEm2gA4OPEAOScwhi8NyPH6ggEPV0af8,260
|
3 |
+
../../../bin/pip3.8,sha256=nMap_ot4S8UAEm2gA4OPEAOScwhi8NyPH6ggEPV0af8,260
|
4 |
+
pip-20.0.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
5 |
+
pip-20.0.2.dist-info/LICENSE.txt,sha256=W6Ifuwlk-TatfRU2LR7W1JMcyMj5_y1NkRkOEJvnRDE,1090
|
6 |
+
pip-20.0.2.dist-info/METADATA,sha256=MSgjT2JTt8usp4Hopp5AGEmc-7sKR2Jd7HTMJqCoRhw,3352
|
7 |
+
pip-20.0.2.dist-info/RECORD,,
|
8 |
+
pip-20.0.2.dist-info/WHEEL,sha256=kGT74LWyRUZrL4VgLh6_g12IeVl_9u9ZVhadrgXZUEY,110
|
9 |
+
pip-20.0.2.dist-info/entry_points.txt,sha256=HtfDOwpUlr9s73jqLQ6wF9V0_0qvUXJwCBz7Vwx0Ue0,125
|
10 |
+
pip-20.0.2.dist-info/top_level.txt,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
11 |
+
pip/__init__.py,sha256=U1AM82iShMaw90K6Yq0Q2-AZ1EsOcqQLQRB-rxwFtII,455
|
12 |
+
pip/__main__.py,sha256=NM95x7KuQr-lwPoTjAC0d_QzLJsJjpmAoxZg0mP8s98,632
|
13 |
+
pip/__pycache__/__init__.cpython-38.pyc,,
|
14 |
+
pip/__pycache__/__main__.cpython-38.pyc,,
|
15 |
+
pip/_internal/__init__.py,sha256=j5fiII6yCeZjpW7_7wAVRMM4DwE-gyARGVU4yAADDeE,517
|
16 |
+
pip/_internal/__pycache__/__init__.cpython-38.pyc,,
|
17 |
+
pip/_internal/__pycache__/build_env.cpython-38.pyc,,
|
18 |
+
pip/_internal/__pycache__/cache.cpython-38.pyc,,
|
19 |
+
pip/_internal/__pycache__/configuration.cpython-38.pyc,,
|
20 |
+
pip/_internal/__pycache__/exceptions.cpython-38.pyc,,
|
21 |
+
pip/_internal/__pycache__/legacy_resolve.cpython-38.pyc,,
|
22 |
+
pip/_internal/__pycache__/locations.cpython-38.pyc,,
|
23 |
+
pip/_internal/__pycache__/main.cpython-38.pyc,,
|
24 |
+
pip/_internal/__pycache__/pep425tags.cpython-38.pyc,,
|
25 |
+
pip/_internal/__pycache__/pyproject.cpython-38.pyc,,
|
26 |
+
pip/_internal/__pycache__/self_outdated_check.cpython-38.pyc,,
|
27 |
+
pip/_internal/__pycache__/wheel_builder.cpython-38.pyc,,
|
28 |
+
pip/_internal/build_env.py,sha256=--aNgzIdYrCOclHMwoAdpclCpfdFE_jooRuCy5gczwg,7532
|
29 |
+
pip/_internal/cache.py,sha256=16GrnDRLBQNlfKWIuIF6Sa-EFS78kez_w1WEjT3ykTI,11605
|
30 |
+
pip/_internal/cli/__init__.py,sha256=FkHBgpxxb-_gd6r1FjnNhfMOzAUYyXoXKJ6abijfcFU,132
|
31 |
+
pip/_internal/cli/__pycache__/__init__.cpython-38.pyc,,
|
32 |
+
pip/_internal/cli/__pycache__/autocompletion.cpython-38.pyc,,
|
33 |
+
pip/_internal/cli/__pycache__/base_command.cpython-38.pyc,,
|
34 |
+
pip/_internal/cli/__pycache__/cmdoptions.cpython-38.pyc,,
|
35 |
+
pip/_internal/cli/__pycache__/command_context.cpython-38.pyc,,
|
36 |
+
pip/_internal/cli/__pycache__/main.cpython-38.pyc,,
|
37 |
+
pip/_internal/cli/__pycache__/main_parser.cpython-38.pyc,,
|
38 |
+
pip/_internal/cli/__pycache__/parser.cpython-38.pyc,,
|
39 |
+
pip/_internal/cli/__pycache__/req_command.cpython-38.pyc,,
|
40 |
+
pip/_internal/cli/__pycache__/status_codes.cpython-38.pyc,,
|
41 |
+
pip/_internal/cli/autocompletion.py,sha256=ekGNtcDI0p7rFVc-7s4T9Tbss4Jgb7vsB649XJIblRg,6547
|
42 |
+
pip/_internal/cli/base_command.py,sha256=v6yl5XNRqye8BT9ep8wvpMu6lylP_Hu6D95r_HqbpbQ,7948
|
43 |
+
pip/_internal/cli/cmdoptions.py,sha256=f1TVHuu_fR3lLlMo6b367H_GsWFv26tLI9cAS-kZfE0,28114
|
44 |
+
pip/_internal/cli/command_context.py,sha256=ygMVoTy2jpNilKT-6416gFSQpaBtrKRBbVbi2fy__EU,975
|
45 |
+
pip/_internal/cli/main.py,sha256=8iq3bHe5lxJTB2EvKOqZ38NS0MmoS79_S1kgj4QuH8A,2610
|
46 |
+
pip/_internal/cli/main_parser.py,sha256=W9OWeryh7ZkqELohaFh0Ko9sB98ZkSeDmnYbOZ1imBc,2819
|
47 |
+
pip/_internal/cli/parser.py,sha256=O9djTuYQuSfObiY-NU6p4MJCfWsRUnDpE2YGA_fwols,9487
|
48 |
+
pip/_internal/cli/req_command.py,sha256=pAUAglpTn0mUA6lRs7KN71yOm1KDabD0ySVTQTqWTSA,12463
|
49 |
+
pip/_internal/cli/status_codes.py,sha256=F6uDG6Gj7RNKQJUDnd87QKqI16Us-t-B0wPF_4QMpWc,156
|
50 |
+
pip/_internal/commands/__init__.py,sha256=uTSj58QlrSKeXqCUSdL-eAf_APzx5BHy1ABxb0j5ZNE,3714
|
51 |
+
pip/_internal/commands/__pycache__/__init__.cpython-38.pyc,,
|
52 |
+
pip/_internal/commands/__pycache__/check.cpython-38.pyc,,
|
53 |
+
pip/_internal/commands/__pycache__/completion.cpython-38.pyc,,
|
54 |
+
pip/_internal/commands/__pycache__/configuration.cpython-38.pyc,,
|
55 |
+
pip/_internal/commands/__pycache__/debug.cpython-38.pyc,,
|
56 |
+
pip/_internal/commands/__pycache__/download.cpython-38.pyc,,
|
57 |
+
pip/_internal/commands/__pycache__/freeze.cpython-38.pyc,,
|
58 |
+
pip/_internal/commands/__pycache__/hash.cpython-38.pyc,,
|
59 |
+
pip/_internal/commands/__pycache__/help.cpython-38.pyc,,
|
60 |
+
pip/_internal/commands/__pycache__/install.cpython-38.pyc,,
|
61 |
+
pip/_internal/commands/__pycache__/list.cpython-38.pyc,,
|
62 |
+
pip/_internal/commands/__pycache__/search.cpython-38.pyc,,
|
63 |
+
pip/_internal/commands/__pycache__/show.cpython-38.pyc,,
|
64 |
+
pip/_internal/commands/__pycache__/uninstall.cpython-38.pyc,,
|
65 |
+
pip/_internal/commands/__pycache__/wheel.cpython-38.pyc,,
|
66 |
+
pip/_internal/commands/check.py,sha256=mgLNYT3bd6Kmynwh4zzcBmVlFZ-urMo40jTgk6U405E,1505
|
67 |
+
pip/_internal/commands/completion.py,sha256=UFQvq0Q4_B96z1bvnQyMOq82aPSu05RejbLmqeTZjC0,2975
|
68 |
+
pip/_internal/commands/configuration.py,sha256=6riioZjMhsNSEct7dE-X8SobGodk3WERKJvuyjBje4Q,7226
|
69 |
+
pip/_internal/commands/debug.py,sha256=a8llax2hRkxgK-tvwdJgaCaZCYPIx0fDvrlMDoYr8bQ,4209
|
70 |
+
pip/_internal/commands/download.py,sha256=zX_0-IeFb4C8dxSmGHxk-6H5kehtyTSsdWpjNpAhSww,5007
|
71 |
+
pip/_internal/commands/freeze.py,sha256=QS-4ib8jbKJ2wrDaDbTuyaB3Y_iJ5CQC2gAVHuAv9QU,3481
|
72 |
+
pip/_internal/commands/hash.py,sha256=47teimfAPhpkaVbSDaafck51BT3XXYuL83lAqc5lOcE,1735
|
73 |
+
pip/_internal/commands/help.py,sha256=Nhecq--ydFn80Gm1Zvbf9943EcRJfO0TnXUhsF0RO7s,1181
|
74 |
+
pip/_internal/commands/install.py,sha256=T4P3J1rw7CQrZX4OUamtcoWMkTrJBfUe6gWpTfZW1bQ,27286
|
75 |
+
pip/_internal/commands/list.py,sha256=2l0JiqHxjxDHNTCb2HZOjwwdo4duS1R0MsqZb6HSMKk,10660
|
76 |
+
pip/_internal/commands/search.py,sha256=7Il8nKZ9mM7qF5jlnBoPvSIFY9f-0-5IbYoX3miTuZY,5148
|
77 |
+
pip/_internal/commands/show.py,sha256=Vzsj2oX0JBl94MPyF3LV8YoMcigl8B2UsMM8zp0pH2s,6792
|
78 |
+
pip/_internal/commands/uninstall.py,sha256=8mldFbrQecSoWDZRqxBgJkrlvx6Y9Iy7cs-2BIgtXt4,2983
|
79 |
+
pip/_internal/commands/wheel.py,sha256=TMU5ZhjLo7BIZQApGPsYfoCsbGTnvP-N9jkgPJXhj1Y,7170
|
80 |
+
pip/_internal/configuration.py,sha256=MgKrLFBJBkF3t2VJM4tvlnEspfSuS4scp_LhHWh53nY,14222
|
81 |
+
pip/_internal/distributions/__init__.py,sha256=ECBUW5Gtu9TjJwyFLvim-i6kUMYVuikNh9I5asL6tbA,959
|
82 |
+
pip/_internal/distributions/__pycache__/__init__.cpython-38.pyc,,
|
83 |
+
pip/_internal/distributions/__pycache__/base.cpython-38.pyc,,
|
84 |
+
pip/_internal/distributions/__pycache__/installed.cpython-38.pyc,,
|
85 |
+
pip/_internal/distributions/__pycache__/sdist.cpython-38.pyc,,
|
86 |
+
pip/_internal/distributions/__pycache__/wheel.cpython-38.pyc,,
|
87 |
+
pip/_internal/distributions/base.py,sha256=ruprpM_L2T2HNi3KLUHlbHimZ1sWVw-3Q0Lb8O7TDAI,1425
|
88 |
+
pip/_internal/distributions/installed.py,sha256=YqlkBKr6TVP1MAYS6SG8ojud21wVOYLMZ8jMLJe9MSU,760
|
89 |
+
pip/_internal/distributions/sdist.py,sha256=D4XTMlCwgPlK69l62GLYkNSVTVe99fR5iAcVt2EbGok,4086
|
90 |
+
pip/_internal/distributions/wheel.py,sha256=95uD-TfaYoq3KiKBdzk9YMN4RRqJ28LNoSTS2K46gek,1294
|
91 |
+
pip/_internal/exceptions.py,sha256=6YRuwXAK6F1iyUWKIkCIpWWN2khkAn1sZOgrFA9S8Ro,10247
|
92 |
+
pip/_internal/index/__init__.py,sha256=vpt-JeTZefh8a-FC22ZeBSXFVbuBcXSGiILhQZJaNpQ,30
|
93 |
+
pip/_internal/index/__pycache__/__init__.cpython-38.pyc,,
|
94 |
+
pip/_internal/index/__pycache__/collector.cpython-38.pyc,,
|
95 |
+
pip/_internal/index/__pycache__/package_finder.cpython-38.pyc,,
|
96 |
+
pip/_internal/index/collector.py,sha256=YS7Ix4oylU7ZbPTPFugh-244GSRqMvdHsGUG6nmz2gE,17892
|
97 |
+
pip/_internal/index/package_finder.py,sha256=2Rg75AOpLj8BN1jyL8EI-Iw-Hv6ibJkrYVARCht3bX8,37542
|
98 |
+
pip/_internal/legacy_resolve.py,sha256=L7R72I7CjVgJlPTggmA1j4b-H8NmxNu_dKVhrpGXGps,16277
|
99 |
+
pip/_internal/locations.py,sha256=VifFEqhc7FWFV8QGoEM3CpECRY8Doq7kTytytxsEgx0,6734
|
100 |
+
pip/_internal/main.py,sha256=IVBnUQ-FG7DK6617uEXRB5_QJqspAsBFmTmTesYkbdQ,437
|
101 |
+
pip/_internal/models/__init__.py,sha256=3DHUd_qxpPozfzouoqa9g9ts1Czr5qaHfFxbnxriepM,63
|
102 |
+
pip/_internal/models/__pycache__/__init__.cpython-38.pyc,,
|
103 |
+
pip/_internal/models/__pycache__/candidate.cpython-38.pyc,,
|
104 |
+
pip/_internal/models/__pycache__/format_control.cpython-38.pyc,,
|
105 |
+
pip/_internal/models/__pycache__/index.cpython-38.pyc,,
|
106 |
+
pip/_internal/models/__pycache__/link.cpython-38.pyc,,
|
107 |
+
pip/_internal/models/__pycache__/scheme.cpython-38.pyc,,
|
108 |
+
pip/_internal/models/__pycache__/search_scope.cpython-38.pyc,,
|
109 |
+
pip/_internal/models/__pycache__/selection_prefs.cpython-38.pyc,,
|
110 |
+
pip/_internal/models/__pycache__/target_python.cpython-38.pyc,,
|
111 |
+
pip/_internal/models/__pycache__/wheel.cpython-38.pyc,,
|
112 |
+
pip/_internal/models/candidate.py,sha256=Y58Bcm6oXUj0iS-yhmerlGo5CQJI2p0Ww9h6hR9zQDw,1150
|
113 |
+
pip/_internal/models/format_control.py,sha256=ICzVjjGwfZYdX-eLLKHjMHLutEJlAGpfj09OG_eMqac,2673
|
114 |
+
pip/_internal/models/index.py,sha256=K59A8-hVhBM20Xkahr4dTwP7OjkJyEqXH11UwHFVgqM,1060
|
115 |
+
pip/_internal/models/link.py,sha256=y0H2ZOk0P6d1lfGUL2Pl09xFgZcRt5HwN2LElMifOpI,6827
|
116 |
+
pip/_internal/models/scheme.py,sha256=vvhBrrno7eVDXcdKHiZWwxhPHf4VG5uSCEkC0QDR2RU,679
|
117 |
+
pip/_internal/models/search_scope.py,sha256=2LXbU4wV8LwqdtXQXNXFYKv-IxiDI_QwSz9ZgbwtAfk,3898
|
118 |
+
pip/_internal/models/selection_prefs.py,sha256=rPeif2KKjhTPXeMoQYffjqh10oWpXhdkxRDaPT1HO8k,1908
|
119 |
+
pip/_internal/models/target_python.py,sha256=c-cFi6zCuo5HYbXNS3rVVpKRaHVh5yQlYEjEW23SidQ,3799
|
120 |
+
pip/_internal/models/wheel.py,sha256=6KLuLKH5b0C5goWQXGSISRaq2UZtkHUEAU1y1Zsrwms,2766
|
121 |
+
pip/_internal/network/__init__.py,sha256=jf6Tt5nV_7zkARBrKojIXItgejvoegVJVKUbhAa5Ioc,50
|
122 |
+
pip/_internal/network/__pycache__/__init__.cpython-38.pyc,,
|
123 |
+
pip/_internal/network/__pycache__/auth.cpython-38.pyc,,
|
124 |
+
pip/_internal/network/__pycache__/cache.cpython-38.pyc,,
|
125 |
+
pip/_internal/network/__pycache__/download.cpython-38.pyc,,
|
126 |
+
pip/_internal/network/__pycache__/session.cpython-38.pyc,,
|
127 |
+
pip/_internal/network/__pycache__/utils.cpython-38.pyc,,
|
128 |
+
pip/_internal/network/__pycache__/xmlrpc.cpython-38.pyc,,
|
129 |
+
pip/_internal/network/auth.py,sha256=K3G1ukKb3PiH8w_UnpXTz8qQsTULO-qdbfOE9zTo1fE,11119
|
130 |
+
pip/_internal/network/cache.py,sha256=51CExcRkXWrgMZ7WsrZ6cmijKfViD5tVgKbBvJHO1IE,2394
|
131 |
+
pip/_internal/network/download.py,sha256=3D9vdJmVwmCUMxzC-TaVI_GvVOpQna3BLEYNPCSx3Fc,6260
|
132 |
+
pip/_internal/network/session.py,sha256=u1IXQfv21R1xv86ulyiB58-be4sYm90eFB0Wp8fVMYw,14702
|
133 |
+
pip/_internal/network/utils.py,sha256=iiixo1OeaQ3niUWiBjg59PN6f1w7vvTww1vFriTD_IU,1959
|
134 |
+
pip/_internal/network/xmlrpc.py,sha256=AL115M3vFJ8xiHVJneb8Hi0ZFeRvdPhblC89w25OG5s,1597
|
135 |
+
pip/_internal/operations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
136 |
+
pip/_internal/operations/__pycache__/__init__.cpython-38.pyc,,
|
137 |
+
pip/_internal/operations/__pycache__/check.cpython-38.pyc,,
|
138 |
+
pip/_internal/operations/__pycache__/freeze.cpython-38.pyc,,
|
139 |
+
pip/_internal/operations/__pycache__/prepare.cpython-38.pyc,,
|
140 |
+
pip/_internal/operations/build/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
141 |
+
pip/_internal/operations/build/__pycache__/__init__.cpython-38.pyc,,
|
142 |
+
pip/_internal/operations/build/__pycache__/metadata.cpython-38.pyc,,
|
143 |
+
pip/_internal/operations/build/__pycache__/metadata_legacy.cpython-38.pyc,,
|
144 |
+
pip/_internal/operations/build/__pycache__/wheel.cpython-38.pyc,,
|
145 |
+
pip/_internal/operations/build/__pycache__/wheel_legacy.cpython-38.pyc,,
|
146 |
+
pip/_internal/operations/build/metadata.py,sha256=yHMi5gHYXcXyHcvUPWHdO-UyOo3McFWljn_nHfM1O9c,1307
|
147 |
+
pip/_internal/operations/build/metadata_legacy.py,sha256=4n6N7BTysqVmEpITzT2UVClyt0Peij_Im8Qm965IWB4,3957
|
148 |
+
pip/_internal/operations/build/wheel.py,sha256=ntltdNP6D2Tpr4V0agssu6rE0F9LaBpJkYT6zSdhEbw,1469
|
149 |
+
pip/_internal/operations/build/wheel_legacy.py,sha256=DYSxQKutwSZnmNvWkwsl2HzE2XQBxV0i0wTphjtUe90,3349
|
150 |
+
pip/_internal/operations/check.py,sha256=a6uHG0daoWpmSPCdL7iYJaGQYZ-CRvPvTnCv2PnIIs0,5353
|
151 |
+
pip/_internal/operations/freeze.py,sha256=td4BeRnW10EXFTZrx6VgygO3CrjqD5B9f0BGzjQm-Ew,10180
|
152 |
+
pip/_internal/operations/install/__init__.py,sha256=mX7hyD2GNBO2mFGokDQ30r_GXv7Y_PLdtxcUv144e-s,51
|
153 |
+
pip/_internal/operations/install/__pycache__/__init__.cpython-38.pyc,,
|
154 |
+
pip/_internal/operations/install/__pycache__/editable_legacy.cpython-38.pyc,,
|
155 |
+
pip/_internal/operations/install/__pycache__/legacy.cpython-38.pyc,,
|
156 |
+
pip/_internal/operations/install/__pycache__/wheel.cpython-38.pyc,,
|
157 |
+
pip/_internal/operations/install/editable_legacy.py,sha256=rJ_xs2qtDUjpY2-n6eYlVyZiNoKbOtZXZrYrcnIELt4,1488
|
158 |
+
pip/_internal/operations/install/legacy.py,sha256=eBV8gHbO9sBlBc-4nuR3Sd2nikHgEcnC9khfeLiypio,4566
|
159 |
+
pip/_internal/operations/install/wheel.py,sha256=xdCjH6uIUyg39Pf8tUaMFUN4a7eozJAFMb_wKcgQlsY,23012
|
160 |
+
pip/_internal/operations/prepare.py,sha256=ro2teBlbBpkRJhBKraP9CoJgVLpueSk62ziWhRToXww,20942
|
161 |
+
pip/_internal/pep425tags.py,sha256=SlIQokevkoKnXhoK3PZvXiDoj8hFKoJ7thDifDtga3k,5490
|
162 |
+
pip/_internal/pyproject.py,sha256=VJKsrXORGiGoDPVKCQhuu4tWlQSTOhoiRlVLRNu4rx4,7400
|
163 |
+
pip/_internal/req/__init__.py,sha256=UVaYPlHZVGRBQQPjvGC_6jJDQtewXm0ws-8Lxhg_TiY,2671
|
164 |
+
pip/_internal/req/__pycache__/__init__.cpython-38.pyc,,
|
165 |
+
pip/_internal/req/__pycache__/constructors.cpython-38.pyc,,
|
166 |
+
pip/_internal/req/__pycache__/req_file.cpython-38.pyc,,
|
167 |
+
pip/_internal/req/__pycache__/req_install.cpython-38.pyc,,
|
168 |
+
pip/_internal/req/__pycache__/req_set.cpython-38.pyc,,
|
169 |
+
pip/_internal/req/__pycache__/req_tracker.cpython-38.pyc,,
|
170 |
+
pip/_internal/req/__pycache__/req_uninstall.cpython-38.pyc,,
|
171 |
+
pip/_internal/req/constructors.py,sha256=w5-kWWVCqlSqcIBitw86yq7XGMPpKrHDfQZSE2mJ_xc,14388
|
172 |
+
pip/_internal/req/req_file.py,sha256=ECqRUicCw5Y08R1YynZAAp8dSKQhDXoc1Q-mY3a9b6I,18485
|
173 |
+
pip/_internal/req/req_install.py,sha256=wjsIr4lDpbVSLqANKJI9mXwRVHaRxcnj8q30UiHoLRA,30442
|
174 |
+
pip/_internal/req/req_set.py,sha256=GsrKmupRKhNMhjkofVfCEHEHfgEvYBxClaQH5xLBQHg,8066
|
175 |
+
pip/_internal/req/req_tracker.py,sha256=27fvVG8Y2MJS1KpU2rBMnQyUEMHG4lkHT_bzbzQK-c0,4723
|
176 |
+
pip/_internal/req/req_uninstall.py,sha256=DWnOsuyYGju6-sylyoCm7GtUNevn9qMAVhjAGLcdXUE,23609
|
177 |
+
pip/_internal/self_outdated_check.py,sha256=3KO1pTJUuYaiV9X0t87I9PimkGL82HbhLWbocqKZpBU,8009
|
178 |
+
pip/_internal/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
179 |
+
pip/_internal/utils/__pycache__/__init__.cpython-38.pyc,,
|
180 |
+
pip/_internal/utils/__pycache__/appdirs.cpython-38.pyc,,
|
181 |
+
pip/_internal/utils/__pycache__/compat.cpython-38.pyc,,
|
182 |
+
pip/_internal/utils/__pycache__/deprecation.cpython-38.pyc,,
|
183 |
+
pip/_internal/utils/__pycache__/distutils_args.cpython-38.pyc,,
|
184 |
+
pip/_internal/utils/__pycache__/encoding.cpython-38.pyc,,
|
185 |
+
pip/_internal/utils/__pycache__/entrypoints.cpython-38.pyc,,
|
186 |
+
pip/_internal/utils/__pycache__/filesystem.cpython-38.pyc,,
|
187 |
+
pip/_internal/utils/__pycache__/filetypes.cpython-38.pyc,,
|
188 |
+
pip/_internal/utils/__pycache__/glibc.cpython-38.pyc,,
|
189 |
+
pip/_internal/utils/__pycache__/hashes.cpython-38.pyc,,
|
190 |
+
pip/_internal/utils/__pycache__/inject_securetransport.cpython-38.pyc,,
|
191 |
+
pip/_internal/utils/__pycache__/logging.cpython-38.pyc,,
|
192 |
+
pip/_internal/utils/__pycache__/marker_files.cpython-38.pyc,,
|
193 |
+
pip/_internal/utils/__pycache__/misc.cpython-38.pyc,,
|
194 |
+
pip/_internal/utils/__pycache__/models.cpython-38.pyc,,
|
195 |
+
pip/_internal/utils/__pycache__/packaging.cpython-38.pyc,,
|
196 |
+
pip/_internal/utils/__pycache__/pkg_resources.cpython-38.pyc,,
|
197 |
+
pip/_internal/utils/__pycache__/setuptools_build.cpython-38.pyc,,
|
198 |
+
pip/_internal/utils/__pycache__/subprocess.cpython-38.pyc,,
|
199 |
+
pip/_internal/utils/__pycache__/temp_dir.cpython-38.pyc,,
|
200 |
+
pip/_internal/utils/__pycache__/typing.cpython-38.pyc,,
|
201 |
+
pip/_internal/utils/__pycache__/ui.cpython-38.pyc,,
|
202 |
+
pip/_internal/utils/__pycache__/unpacking.cpython-38.pyc,,
|
203 |
+
pip/_internal/utils/__pycache__/urls.cpython-38.pyc,,
|
204 |
+
pip/_internal/utils/__pycache__/virtualenv.cpython-38.pyc,,
|
205 |
+
pip/_internal/utils/__pycache__/wheel.cpython-38.pyc,,
|
206 |
+
pip/_internal/utils/appdirs.py,sha256=PVo_7-IQWHa9qNuNbWSFiF2QGqeLbSAR4eLcYYhQ9ek,1307
|
207 |
+
pip/_internal/utils/compat.py,sha256=D7FKGLBdQwWH-dHIGaoWMawDZWBYApvtJVL1kFPJ930,8869
|
208 |
+
pip/_internal/utils/deprecation.py,sha256=pBnNogoA4UGTxa_JDnPXBRRYpKMbExAhXpBwAwklOBs,3318
|
209 |
+
pip/_internal/utils/distutils_args.py,sha256=a56mblNxk9BGifbpEETG61mmBrqhjtjRkJ4HYn-oOEE,1350
|
210 |
+
pip/_internal/utils/encoding.py,sha256=hxZz0t3Whw3d4MHQEiofxalTlfKwxFdLc8fpeGfhKo8,1320
|
211 |
+
pip/_internal/utils/entrypoints.py,sha256=vHcNpnksCv6mllihU6hfifdsKPEjwcaJ1aLIXEaynaU,1152
|
212 |
+
pip/_internal/utils/filesystem.py,sha256=PXa3vMcz4mbEKtkD0joFI8pBwddLQxhfPFOkVH5xjfE,5255
|
213 |
+
pip/_internal/utils/filetypes.py,sha256=R2FwzoeX7b-rZALOXx5cuO8VPPMhUQ4ne7wm3n3IcWA,571
|
214 |
+
pip/_internal/utils/glibc.py,sha256=LOeNGgawCKS-4ke9fii78fwXD73dtNav3uxz1Bf-Ab8,3297
|
215 |
+
pip/_internal/utils/hashes.py,sha256=my-wSnAWEDvl_8rQaOQcVIWjwh1-f_QiEvGy9TPf53U,3942
|
216 |
+
pip/_internal/utils/inject_securetransport.py,sha256=M17ZlFVY66ApgeASVjKKLKNz0LAfk-SyU0HZ4ZB6MmI,810
|
217 |
+
pip/_internal/utils/logging.py,sha256=aJL7NldPhS5KGFof6Qt3o3MG5cjm5TOoo7bGRu9_wsg,13033
|
218 |
+
pip/_internal/utils/marker_files.py,sha256=CO5djQlrPIozJpJybViH_insoAaBGY1aqEt6-cC-iW0,741
|
219 |
+
pip/_internal/utils/misc.py,sha256=uIb58Hiu_g2HRORo2aMcgnW_7R5d-5wUAuoW0fA2ZME,26085
|
220 |
+
pip/_internal/utils/models.py,sha256=IA0hw_T4awQzui0kqfIEASm5yLtgZAB08ag59Nip5G8,1148
|
221 |
+
pip/_internal/utils/packaging.py,sha256=VtiwcAAL7LBi7tGL2je7LeW4bE11KMHGCsJ1NZY5XtM,3035
|
222 |
+
pip/_internal/utils/pkg_resources.py,sha256=ZX-k7V5q_aNWyDse92nN7orN1aCpRLsaxzpkBZ1XKzU,1254
|
223 |
+
pip/_internal/utils/setuptools_build.py,sha256=DouaVolV9olDDFIIN9IszaL-FHdNaZt10ufOZFH9ZAU,5070
|
224 |
+
pip/_internal/utils/subprocess.py,sha256=Ph3x5eHQBxFotyGhpZN8asSMBud-BBkmgaNfARG-di8,9922
|
225 |
+
pip/_internal/utils/temp_dir.py,sha256=87Ib8aNic_hoSDEmUYJHTQIn5-prL2AYL5u_yZ3s4sI,7768
|
226 |
+
pip/_internal/utils/typing.py,sha256=xkYwOeHlf4zsHXBDC4310HtEqwhQcYXFPq2h35Tcrl0,1401
|
227 |
+
pip/_internal/utils/ui.py,sha256=0FNxXlGtbpPtTviv2oXS9t8bQG_NBdfUgP4GbubhS9U,13911
|
228 |
+
pip/_internal/utils/unpacking.py,sha256=M944JTSiapBOSKLWu7lbawpVHSE7flfzZTEr3TAG7v8,9438
|
229 |
+
pip/_internal/utils/urls.py,sha256=aNV9wq5ClUmrz6sG-al7hEWJ4ToitOy7l82CmFGFNW8,1481
|
230 |
+
pip/_internal/utils/virtualenv.py,sha256=Q3S1WPlI7JWpGOT2jUVJ8l2chm_k7VPJ9cHA_cUluEU,3396
|
231 |
+
pip/_internal/utils/wheel.py,sha256=grTRwZtMQwApwbbSPmRVLtac6FKy6SVKeCXNkWyyePA,7302
|
232 |
+
pip/_internal/vcs/__init__.py,sha256=viJxJRqRE_mVScum85bgQIXAd6o0ozFt18VpC-qIJrM,617
|
233 |
+
pip/_internal/vcs/__pycache__/__init__.cpython-38.pyc,,
|
234 |
+
pip/_internal/vcs/__pycache__/bazaar.cpython-38.pyc,,
|
235 |
+
pip/_internal/vcs/__pycache__/git.cpython-38.pyc,,
|
236 |
+
pip/_internal/vcs/__pycache__/mercurial.cpython-38.pyc,,
|
237 |
+
pip/_internal/vcs/__pycache__/subversion.cpython-38.pyc,,
|
238 |
+
pip/_internal/vcs/__pycache__/versioncontrol.cpython-38.pyc,,
|
239 |
+
pip/_internal/vcs/bazaar.py,sha256=84q1-kj1_nJ9AMzMu8RmMp-riRZu81M7K9kowcYgi3U,3957
|
240 |
+
pip/_internal/vcs/git.py,sha256=CdLz3DTsZsLMLPZpEuUwiS40npvDaVB1CNRzoXgcuJQ,14352
|
241 |
+
pip/_internal/vcs/mercurial.py,sha256=2mg7BdYI_Fe00fF6omaNccFQLPHBsDBG5CAEzvqn5sA,5110
|
242 |
+
pip/_internal/vcs/subversion.py,sha256=Fpwy71AmuqXnoKi6h1SrXRtPjEMn8fieuM1O4j01IBg,12292
|
243 |
+
pip/_internal/vcs/versioncontrol.py,sha256=nqoaM1_rzx24WnHtihXA8RcPpnUae0sV2sR_LS_5HFA,22600
|
244 |
+
pip/_internal/wheel_builder.py,sha256=gr9jE14W5ZuYblpldo-tpRuyG0e0AVmHLttImuAvXlE,9441
|
245 |
+
pip/_vendor/__init__.py,sha256=-0H8nYPGWX7724kAmvYHNUE268FaYlWrNW518BygiUo,4979
|
246 |
+
pip/_vendor/__pycache__/__init__.cpython-38.pyc,,
|
jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/WHEEL
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Wheel-Version: 1.0
|
2 |
+
Generator: bdist_wheel (0.34.2)
|
3 |
+
Root-Is-Purelib: true
|
4 |
+
Tag: py2-none-any
|
5 |
+
Tag: py3-none-any
|
6 |
+
|
jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/entry_points.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
[console_scripts]
|
2 |
+
pip = pip._internal.cli.main:main
|
3 |
+
pip3 = pip._internal.cli.main:main
|
4 |
+
pip3.8 = pip._internal.cli.main:main
|
5 |
+
|
jax_env/lib/python3.8/site-packages/pip-20.0.2.dist-info/top_level.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pip
|
jax_env/lib/python3.8/site-packages/pip/__init__.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
2 |
+
|
3 |
+
if MYPY_CHECK_RUNNING:
|
4 |
+
from typing import List, Optional
|
5 |
+
|
6 |
+
|
7 |
+
__version__ = "20.0.2"
|
8 |
+
|
9 |
+
|
10 |
+
def main(args=None):
|
11 |
+
# type: (Optional[List[str]]) -> int
|
12 |
+
"""This is an internal API only meant for use by pip's own console scripts.
|
13 |
+
|
14 |
+
For additional details, see https://github.com/pypa/pip/issues/7498.
|
15 |
+
"""
|
16 |
+
from pip._internal.utils.entrypoints import _wrapper
|
17 |
+
|
18 |
+
return _wrapper(args)
|
jax_env/lib/python3.8/site-packages/pip/__main__.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from __future__ import absolute_import
|
2 |
+
|
3 |
+
import os
|
4 |
+
import sys
|
5 |
+
|
6 |
+
# If we are running from a wheel, add the wheel to sys.path
|
7 |
+
# This allows the usage python pip-*.whl/pip install pip-*.whl
|
8 |
+
if __package__ == '':
|
9 |
+
# __file__ is pip-*.whl/pip/__main__.py
|
10 |
+
# first dirname call strips of '/__main__.py', second strips off '/pip'
|
11 |
+
# Resulting path is the name of the wheel itself
|
12 |
+
# Add that to sys.path so we can import pip
|
13 |
+
path = os.path.dirname(os.path.dirname(__file__))
|
14 |
+
sys.path.insert(0, path)
|
15 |
+
|
16 |
+
from pip._internal.cli.main import main as _main # isort:skip # noqa
|
17 |
+
|
18 |
+
if __name__ == '__main__':
|
19 |
+
sys.exit(_main())
|
jax_env/lib/python3.8/site-packages/pip/__pycache__/__init__.cpython-38.pyc
ADDED
Binary file (629 Bytes). View file
|
|
jax_env/lib/python3.8/site-packages/pip/__pycache__/__main__.cpython-38.pyc
ADDED
Binary file (422 Bytes). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__init__.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/usr/bin/env python
|
2 |
+
import pip._internal.utils.inject_securetransport # noqa
|
3 |
+
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
4 |
+
|
5 |
+
if MYPY_CHECK_RUNNING:
|
6 |
+
from typing import Optional, List
|
7 |
+
|
8 |
+
|
9 |
+
def main(args=None):
|
10 |
+
# type: (Optional[List[str]]) -> int
|
11 |
+
"""This is preserved for old console scripts that may still be referencing
|
12 |
+
it.
|
13 |
+
|
14 |
+
For additional details, see https://github.com/pypa/pip/issues/7498.
|
15 |
+
"""
|
16 |
+
from pip._internal.utils.entrypoints import _wrapper
|
17 |
+
|
18 |
+
return _wrapper(args)
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/__init__.cpython-38.pyc
ADDED
Binary file (678 Bytes). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/build_env.cpython-38.pyc
ADDED
Binary file (7.48 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/cache.cpython-38.pyc
ADDED
Binary file (8.7 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/configuration.cpython-38.pyc
ADDED
Binary file (10.6 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/exceptions.cpython-38.pyc
ADDED
Binary file (12.5 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/legacy_resolve.cpython-38.pyc
ADDED
Binary file (9.9 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/locations.cpython-38.pyc
ADDED
Binary file (4.49 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/main.cpython-38.pyc
ADDED
Binary file (615 Bytes). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/pep425tags.cpython-38.pyc
ADDED
Binary file (3.58 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/pyproject.cpython-38.pyc
ADDED
Binary file (3.73 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/self_outdated_check.cpython-38.pyc
ADDED
Binary file (5.49 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/__pycache__/wheel_builder.cpython-38.pyc
ADDED
Binary file (6.7 kB). View file
|
|
jax_env/lib/python3.8/site-packages/pip/_internal/build_env.py
ADDED
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Build Environment used for isolation during sdist building
|
2 |
+
"""
|
3 |
+
|
4 |
+
# The following comment should be removed at some point in the future.
|
5 |
+
# mypy: strict-optional=False
|
6 |
+
# mypy: disallow-untyped-defs=False
|
7 |
+
|
8 |
+
import logging
|
9 |
+
import os
|
10 |
+
import sys
|
11 |
+
import textwrap
|
12 |
+
from collections import OrderedDict
|
13 |
+
from distutils.sysconfig import get_python_lib
|
14 |
+
from sysconfig import get_paths
|
15 |
+
|
16 |
+
from pip._vendor.pkg_resources import Requirement, VersionConflict, WorkingSet
|
17 |
+
|
18 |
+
from pip import __file__ as pip_location
|
19 |
+
from pip._internal.utils.subprocess import call_subprocess
|
20 |
+
from pip._internal.utils.temp_dir import TempDirectory
|
21 |
+
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
22 |
+
from pip._internal.utils.ui import open_spinner
|
23 |
+
|
24 |
+
if MYPY_CHECK_RUNNING:
|
25 |
+
from typing import Tuple, Set, Iterable, Optional, List
|
26 |
+
from pip._internal.index.package_finder import PackageFinder
|
27 |
+
|
28 |
+
logger = logging.getLogger(__name__)
|
29 |
+
|
30 |
+
|
31 |
+
class _Prefix:
|
32 |
+
|
33 |
+
def __init__(self, path):
|
34 |
+
# type: (str) -> None
|
35 |
+
self.path = path
|
36 |
+
self.setup = False
|
37 |
+
self.bin_dir = get_paths(
|
38 |
+
'nt' if os.name == 'nt' else 'posix_prefix',
|
39 |
+
vars={'base': path, 'platbase': path}
|
40 |
+
)['scripts']
|
41 |
+
# Note: prefer distutils' sysconfig to get the
|
42 |
+
# library paths so PyPy is correctly supported.
|
43 |
+
purelib = get_python_lib(plat_specific=False, prefix=path)
|
44 |
+
platlib = get_python_lib(plat_specific=True, prefix=path)
|
45 |
+
if purelib == platlib:
|
46 |
+
self.lib_dirs = [purelib]
|
47 |
+
else:
|
48 |
+
self.lib_dirs = [purelib, platlib]
|
49 |
+
|
50 |
+
|
51 |
+
class BuildEnvironment(object):
|
52 |
+
"""Creates and manages an isolated environment to install build deps
|
53 |
+
"""
|
54 |
+
|
55 |
+
def __init__(self):
|
56 |
+
# type: () -> None
|
57 |
+
self._temp_dir = TempDirectory(kind="build-env")
|
58 |
+
|
59 |
+
self._prefixes = OrderedDict((
|
60 |
+
(name, _Prefix(os.path.join(self._temp_dir.path, name)))
|
61 |
+
for name in ('normal', 'overlay')
|
62 |
+
))
|
63 |
+
|
64 |
+
self._bin_dirs = [] # type: List[str]
|
65 |
+
self._lib_dirs = [] # type: List[str]
|
66 |
+
for prefix in reversed(list(self._prefixes.values())):
|
67 |
+
self._bin_dirs.append(prefix.bin_dir)
|
68 |
+
self._lib_dirs.extend(prefix.lib_dirs)
|
69 |
+
|
70 |
+
# Customize site to:
|
71 |
+
# - ensure .pth files are honored
|
72 |
+
# - prevent access to system site packages
|
73 |
+
system_sites = {
|
74 |
+
os.path.normcase(site) for site in (
|
75 |
+
get_python_lib(plat_specific=False),
|
76 |
+
get_python_lib(plat_specific=True),
|
77 |
+
)
|
78 |
+
}
|
79 |
+
self._site_dir = os.path.join(self._temp_dir.path, 'site')
|
80 |
+
if not os.path.exists(self._site_dir):
|
81 |
+
os.mkdir(self._site_dir)
|
82 |
+
with open(os.path.join(self._site_dir, 'sitecustomize.py'), 'w') as fp:
|
83 |
+
fp.write(textwrap.dedent(
|
84 |
+
'''
|
85 |
+
import os, site, sys
|
86 |
+
|
87 |
+
# First, drop system-sites related paths.
|
88 |
+
original_sys_path = sys.path[:]
|
89 |
+
known_paths = set()
|
90 |
+
for path in {system_sites!r}:
|
91 |
+
site.addsitedir(path, known_paths=known_paths)
|
92 |
+
system_paths = set(
|
93 |
+
os.path.normcase(path)
|
94 |
+
for path in sys.path[len(original_sys_path):]
|
95 |
+
)
|
96 |
+
original_sys_path = [
|
97 |
+
path for path in original_sys_path
|
98 |
+
if os.path.normcase(path) not in system_paths
|
99 |
+
]
|
100 |
+
sys.path = original_sys_path
|
101 |
+
|
102 |
+
# Second, add lib directories.
|
103 |
+
# ensuring .pth file are processed.
|
104 |
+
for path in {lib_dirs!r}:
|
105 |
+
assert not path in sys.path
|
106 |
+
site.addsitedir(path)
|
107 |
+
'''
|
108 |
+
).format(system_sites=system_sites, lib_dirs=self._lib_dirs))
|
109 |
+
|
110 |
+
def __enter__(self):
|
111 |
+
self._save_env = {
|
112 |
+
name: os.environ.get(name, None)
|
113 |
+
for name in ('PATH', 'PYTHONNOUSERSITE', 'PYTHONPATH')
|
114 |
+
}
|
115 |
+
|
116 |
+
path = self._bin_dirs[:]
|
117 |
+
old_path = self._save_env['PATH']
|
118 |
+
if old_path:
|
119 |
+
path.extend(old_path.split(os.pathsep))
|
120 |
+
|
121 |
+
pythonpath = [self._site_dir]
|
122 |
+
|
123 |
+
os.environ.update({
|
124 |
+
'PATH': os.pathsep.join(path),
|
125 |
+
'PYTHONNOUSERSITE': '1',
|
126 |
+
'PYTHONPATH': os.pathsep.join(pythonpath),
|
127 |
+
})
|
128 |
+
|
129 |
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
130 |
+
for varname, old_value in self._save_env.items():
|
131 |
+
if old_value is None:
|
132 |
+
os.environ.pop(varname, None)
|
133 |
+
else:
|
134 |
+
os.environ[varname] = old_value
|
135 |
+
|
136 |
+
def cleanup(self):
|
137 |
+
# type: () -> None
|
138 |
+
self._temp_dir.cleanup()
|
139 |
+
|
140 |
+
def check_requirements(self, reqs):
|
141 |
+
# type: (Iterable[str]) -> Tuple[Set[Tuple[str, str]], Set[str]]
|
142 |
+
"""Return 2 sets:
|
143 |
+
- conflicting requirements: set of (installed, wanted) reqs tuples
|
144 |
+
- missing requirements: set of reqs
|
145 |
+
"""
|
146 |
+
missing = set()
|
147 |
+
conflicting = set()
|
148 |
+
if reqs:
|
149 |
+
ws = WorkingSet(self._lib_dirs)
|
150 |
+
for req in reqs:
|
151 |
+
try:
|
152 |
+
if ws.find(Requirement.parse(req)) is None:
|
153 |
+
missing.add(req)
|
154 |
+
except VersionConflict as e:
|
155 |
+
conflicting.add((str(e.args[0].as_requirement()),
|
156 |
+
str(e.args[1])))
|
157 |
+
return conflicting, missing
|
158 |
+
|
159 |
+
def install_requirements(
|
160 |
+
self,
|
161 |
+
finder, # type: PackageFinder
|
162 |
+
requirements, # type: Iterable[str]
|
163 |
+
prefix_as_string, # type: str
|
164 |
+
message # type: Optional[str]
|
165 |
+
):
|
166 |
+
# type: (...) -> None
|
167 |
+
prefix = self._prefixes[prefix_as_string]
|
168 |
+
assert not prefix.setup
|
169 |
+
prefix.setup = True
|
170 |
+
if not requirements:
|
171 |
+
return
|
172 |
+
args = [
|
173 |
+
sys.executable, os.path.dirname(pip_location), 'install',
|
174 |
+
'--ignore-installed', '--no-user', '--prefix', prefix.path,
|
175 |
+
'--no-warn-script-location',
|
176 |
+
] # type: List[str]
|
177 |
+
if logger.getEffectiveLevel() <= logging.DEBUG:
|
178 |
+
args.append('-v')
|
179 |
+
for format_control in ('no_binary', 'only_binary'):
|
180 |
+
formats = getattr(finder.format_control, format_control)
|
181 |
+
args.extend(('--' + format_control.replace('_', '-'),
|
182 |
+
','.join(sorted(formats or {':none:'}))))
|
183 |
+
|
184 |
+
index_urls = finder.index_urls
|
185 |
+
if index_urls:
|
186 |
+
args.extend(['-i', index_urls[0]])
|
187 |
+
for extra_index in index_urls[1:]:
|
188 |
+
args.extend(['--extra-index-url', extra_index])
|
189 |
+
else:
|
190 |
+
args.append('--no-index')
|
191 |
+
for link in finder.find_links:
|
192 |
+
args.extend(['--find-links', link])
|
193 |
+
|
194 |
+
for host in finder.trusted_hosts:
|
195 |
+
args.extend(['--trusted-host', host])
|
196 |
+
if finder.allow_all_prereleases:
|
197 |
+
args.append('--pre')
|
198 |
+
args.append('--')
|
199 |
+
args.extend(requirements)
|
200 |
+
with open_spinner(message) as spinner:
|
201 |
+
call_subprocess(args, spinner=spinner)
|
202 |
+
|
203 |
+
|
204 |
+
class NoOpBuildEnvironment(BuildEnvironment):
|
205 |
+
"""A no-op drop-in replacement for BuildEnvironment
|
206 |
+
"""
|
207 |
+
|
208 |
+
def __init__(self):
|
209 |
+
pass
|
210 |
+
|
211 |
+
def __enter__(self):
|
212 |
+
pass
|
213 |
+
|
214 |
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
215 |
+
pass
|
216 |
+
|
217 |
+
def cleanup(self):
|
218 |
+
pass
|
219 |
+
|
220 |
+
def install_requirements(self, finder, requirements, prefix, message):
|
221 |
+
raise NotImplementedError()
|
jax_env/lib/python3.8/site-packages/pip/_internal/cache.py
ADDED
@@ -0,0 +1,329 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Cache Management
|
2 |
+
"""
|
3 |
+
|
4 |
+
# The following comment should be removed at some point in the future.
|
5 |
+
# mypy: strict-optional=False
|
6 |
+
|
7 |
+
import hashlib
|
8 |
+
import json
|
9 |
+
import logging
|
10 |
+
import os
|
11 |
+
|
12 |
+
from pip._vendor.packaging.tags import interpreter_name, interpreter_version
|
13 |
+
from pip._vendor.packaging.utils import canonicalize_name
|
14 |
+
|
15 |
+
from pip._internal.exceptions import InvalidWheelFilename
|
16 |
+
from pip._internal.models.link import Link
|
17 |
+
from pip._internal.models.wheel import Wheel
|
18 |
+
from pip._internal.utils.temp_dir import TempDirectory
|
19 |
+
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
|
20 |
+
from pip._internal.utils.urls import path_to_url
|
21 |
+
|
22 |
+
if MYPY_CHECK_RUNNING:
|
23 |
+
from typing import Optional, Set, List, Any, Dict
|
24 |
+
|
25 |
+
from pip._vendor.packaging.tags import Tag
|
26 |
+
|
27 |
+
from pip._internal.models.format_control import FormatControl
|
28 |
+
|
29 |
+
logger = logging.getLogger(__name__)
|
30 |
+
|
31 |
+
|
32 |
+
def _hash_dict(d):
|
33 |
+
# type: (Dict[str, str]) -> str
|
34 |
+
"""Return a stable sha224 of a dictionary."""
|
35 |
+
s = json.dumps(d, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
|
36 |
+
return hashlib.sha224(s.encode("ascii")).hexdigest()
|
37 |
+
|
38 |
+
|
39 |
+
class Cache(object):
|
40 |
+
"""An abstract class - provides cache directories for data from links
|
41 |
+
|
42 |
+
|
43 |
+
:param cache_dir: The root of the cache.
|
44 |
+
:param format_control: An object of FormatControl class to limit
|
45 |
+
binaries being read from the cache.
|
46 |
+
:param allowed_formats: which formats of files the cache should store.
|
47 |
+
('binary' and 'source' are the only allowed values)
|
48 |
+
"""
|
49 |
+
|
50 |
+
def __init__(self, cache_dir, format_control, allowed_formats):
|
51 |
+
# type: (str, FormatControl, Set[str]) -> None
|
52 |
+
super(Cache, self).__init__()
|
53 |
+
assert not cache_dir or os.path.isabs(cache_dir)
|
54 |
+
self.cache_dir = cache_dir or None
|
55 |
+
self.format_control = format_control
|
56 |
+
self.allowed_formats = allowed_formats
|
57 |
+
|
58 |
+
_valid_formats = {"source", "binary"}
|
59 |
+
assert self.allowed_formats.union(_valid_formats) == _valid_formats
|
60 |
+
|
61 |
+
def _get_cache_path_parts_legacy(self, link):
|
62 |
+
# type: (Link) -> List[str]
|
63 |
+
"""Get parts of part that must be os.path.joined with cache_dir
|
64 |
+
|
65 |
+
Legacy cache key (pip < 20) for compatibility with older caches.
|
66 |
+
"""
|
67 |
+
|
68 |
+
# We want to generate an url to use as our cache key, we don't want to
|
69 |
+
# just re-use the URL because it might have other items in the fragment
|
70 |
+
# and we don't care about those.
|
71 |
+
key_parts = [link.url_without_fragment]
|
72 |
+
if link.hash_name is not None and link.hash is not None:
|
73 |
+
key_parts.append("=".join([link.hash_name, link.hash]))
|
74 |
+
key_url = "#".join(key_parts)
|
75 |
+
|
76 |
+
# Encode our key url with sha224, we'll use this because it has similar
|
77 |
+
# security properties to sha256, but with a shorter total output (and
|
78 |
+
# thus less secure). However the differences don't make a lot of
|
79 |
+
# difference for our use case here.
|
80 |
+
hashed = hashlib.sha224(key_url.encode()).hexdigest()
|
81 |
+
|
82 |
+
# We want to nest the directories some to prevent having a ton of top
|
83 |
+
# level directories where we might run out of sub directories on some
|
84 |
+
# FS.
|
85 |
+
parts = [hashed[:2], hashed[2:4], hashed[4:6], hashed[6:]]
|
86 |
+
|
87 |
+
return parts
|
88 |
+
|
89 |
+
def _get_cache_path_parts(self, link):
|
90 |
+
# type: (Link) -> List[str]
|
91 |
+
"""Get parts of part that must be os.path.joined with cache_dir
|
92 |
+
"""
|
93 |
+
|
94 |
+
# We want to generate an url to use as our cache key, we don't want to
|
95 |
+
# just re-use the URL because it might have other items in the fragment
|
96 |
+
# and we don't care about those.
|
97 |
+
key_parts = {"url": link.url_without_fragment}
|
98 |
+
if link.hash_name is not None and link.hash is not None:
|
99 |
+
key_parts[link.hash_name] = link.hash
|
100 |
+
if link.subdirectory_fragment:
|
101 |
+
key_parts["subdirectory"] = link.subdirectory_fragment
|
102 |
+
|
103 |
+
# Include interpreter name, major and minor version in cache key
|
104 |
+
# to cope with ill-behaved sdists that build a different wheel
|
105 |
+
# depending on the python version their setup.py is being run on,
|
106 |
+
# and don't encode the difference in compatibility tags.
|
107 |
+
# https://github.com/pypa/pip/issues/7296
|
108 |
+
key_parts["interpreter_name"] = interpreter_name()
|
109 |
+
key_parts["interpreter_version"] = interpreter_version()
|
110 |
+
|
111 |
+
# Encode our key url with sha224, we'll use this because it has similar
|
112 |
+
# security properties to sha256, but with a shorter total output (and
|
113 |
+
# thus less secure). However the differences don't make a lot of
|
114 |
+
# difference for our use case here.
|
115 |
+
hashed = _hash_dict(key_parts)
|
116 |
+
|
117 |
+
# We want to nest the directories some to prevent having a ton of top
|
118 |
+
# level directories where we might run out of sub directories on some
|
119 |
+
# FS.
|
120 |
+
parts = [hashed[:2], hashed[2:4], hashed[4:6], hashed[6:]]
|
121 |
+
|
122 |
+
return parts
|
123 |
+
|
124 |
+
def _get_candidates(self, link, canonical_package_name):
|
125 |
+
# type: (Link, Optional[str]) -> List[Any]
|
126 |
+
can_not_cache = (
|
127 |
+
not self.cache_dir or
|
128 |
+
not canonical_package_name or
|
129 |
+
not link
|
130 |
+
)
|
131 |
+
if can_not_cache:
|
132 |
+
return []
|
133 |
+
|
134 |
+
formats = self.format_control.get_allowed_formats(
|
135 |
+
canonical_package_name
|
136 |
+
)
|
137 |
+
if not self.allowed_formats.intersection(formats):
|
138 |
+
return []
|
139 |
+
|
140 |
+
candidates = []
|
141 |
+
path = self.get_path_for_link(link)
|
142 |
+
if os.path.isdir(path):
|
143 |
+
for candidate in os.listdir(path):
|
144 |
+
candidates.append((candidate, path))
|
145 |
+
# TODO remove legacy path lookup in pip>=21
|
146 |
+
legacy_path = self.get_path_for_link_legacy(link)
|
147 |
+
if os.path.isdir(legacy_path):
|
148 |
+
for candidate in os.listdir(legacy_path):
|
149 |
+
candidates.append((candidate, legacy_path))
|
150 |
+
return candidates
|
151 |
+
|
152 |
+
def get_path_for_link_legacy(self, link):
|
153 |
+
# type: (Link) -> str
|
154 |
+
raise NotImplementedError()
|
155 |
+
|
156 |
+
def get_path_for_link(self, link):
|
157 |
+
# type: (Link) -> str
|
158 |
+
"""Return a directory to store cached items in for link.
|
159 |
+
"""
|
160 |
+
raise NotImplementedError()
|
161 |
+
|
162 |
+
def get(
|
163 |
+
self,
|
164 |
+
link, # type: Link
|
165 |
+
package_name, # type: Optional[str]
|
166 |
+
supported_tags, # type: List[Tag]
|
167 |
+
):
|
168 |
+
# type: (...) -> Link
|
169 |
+
"""Returns a link to a cached item if it exists, otherwise returns the
|
170 |
+
passed link.
|
171 |
+
"""
|
172 |
+
raise NotImplementedError()
|
173 |
+
|
174 |
+
def cleanup(self):
|
175 |
+
# type: () -> None
|
176 |
+
pass
|
177 |
+
|
178 |
+
|
179 |
+
class SimpleWheelCache(Cache):
|
180 |
+
"""A cache of wheels for future installs.
|
181 |
+
"""
|
182 |
+
|
183 |
+
def __init__(self, cache_dir, format_control):
|
184 |
+
# type: (str, FormatControl) -> None
|
185 |
+
super(SimpleWheelCache, self).__init__(
|
186 |
+
cache_dir, format_control, {"binary"}
|
187 |
+
)
|
188 |
+
|
189 |
+
def get_path_for_link_legacy(self, link):
|
190 |
+
# type: (Link) -> str
|
191 |
+
parts = self._get_cache_path_parts_legacy(link)
|
192 |
+
return os.path.join(self.cache_dir, "wheels", *parts)
|
193 |
+
|
194 |
+
def get_path_for_link(self, link):
|
195 |
+
# type: (Link) -> str
|
196 |
+
"""Return a directory to store cached wheels for link
|
197 |
+
|
198 |
+
Because there are M wheels for any one sdist, we provide a directory
|
199 |
+
to cache them in, and then consult that directory when looking up
|
200 |
+
cache hits.
|
201 |
+
|
202 |
+
We only insert things into the cache if they have plausible version
|
203 |
+
numbers, so that we don't contaminate the cache with things that were
|
204 |
+
not unique. E.g. ./package might have dozens of installs done for it
|
205 |
+
and build a version of 0.0...and if we built and cached a wheel, we'd
|
206 |
+
end up using the same wheel even if the source has been edited.
|
207 |
+
|
208 |
+
:param link: The link of the sdist for which this will cache wheels.
|
209 |
+
"""
|
210 |
+
parts = self._get_cache_path_parts(link)
|
211 |
+
|
212 |
+
# Store wheels within the root cache_dir
|
213 |
+
return os.path.join(self.cache_dir, "wheels", *parts)
|
214 |
+
|
215 |
+
def get(
|
216 |
+
self,
|
217 |
+
link, # type: Link
|
218 |
+
package_name, # type: Optional[str]
|
219 |
+
supported_tags, # type: List[Tag]
|
220 |
+
):
|
221 |
+
# type: (...) -> Link
|
222 |
+
candidates = []
|
223 |
+
|
224 |
+
if not package_name:
|
225 |
+
return link
|
226 |
+
|
227 |
+
canonical_package_name = canonicalize_name(package_name)
|
228 |
+
for wheel_name, wheel_dir in self._get_candidates(
|
229 |
+
link, canonical_package_name
|
230 |
+
):
|
231 |
+
try:
|
232 |
+
wheel = Wheel(wheel_name)
|
233 |
+
except InvalidWheelFilename:
|
234 |
+
continue
|
235 |
+
if canonicalize_name(wheel.name) != canonical_package_name:
|
236 |
+
logger.debug(
|
237 |
+
"Ignoring cached wheel {} for {} as it "
|
238 |
+
"does not match the expected distribution name {}.".format(
|
239 |
+
wheel_name, link, package_name
|
240 |
+
)
|
241 |
+
)
|
242 |
+
continue
|
243 |
+
if not wheel.supported(supported_tags):
|
244 |
+
# Built for a different python/arch/etc
|
245 |
+
continue
|
246 |
+
candidates.append(
|
247 |
+
(
|
248 |
+
wheel.support_index_min(supported_tags),
|
249 |
+
wheel_name,
|
250 |
+
wheel_dir,
|
251 |
+
)
|
252 |
+
)
|
253 |
+
|
254 |
+
if not candidates:
|
255 |
+
return link
|
256 |
+
|
257 |
+
_, wheel_name, wheel_dir = min(candidates)
|
258 |
+
return Link(path_to_url(os.path.join(wheel_dir, wheel_name)))
|
259 |
+
|
260 |
+
|
261 |
+
class EphemWheelCache(SimpleWheelCache):
|
262 |
+
"""A SimpleWheelCache that creates it's own temporary cache directory
|
263 |
+
"""
|
264 |
+
|
265 |
+
def __init__(self, format_control):
|
266 |
+
# type: (FormatControl) -> None
|
267 |
+
self._temp_dir = TempDirectory(kind="ephem-wheel-cache")
|
268 |
+
|
269 |
+
super(EphemWheelCache, self).__init__(
|
270 |
+
self._temp_dir.path, format_control
|
271 |
+
)
|
272 |
+
|
273 |
+
def cleanup(self):
|
274 |
+
# type: () -> None
|
275 |
+
self._temp_dir.cleanup()
|
276 |
+
|
277 |
+
|
278 |
+
class WheelCache(Cache):
|
279 |
+
"""Wraps EphemWheelCache and SimpleWheelCache into a single Cache
|
280 |
+
|
281 |
+
This Cache allows for gracefully degradation, using the ephem wheel cache
|
282 |
+
when a certain link is not found in the simple wheel cache first.
|
283 |
+
"""
|
284 |
+
|
285 |
+
def __init__(self, cache_dir, format_control):
|
286 |
+
# type: (str, FormatControl) -> None
|
287 |
+
super(WheelCache, self).__init__(
|
288 |
+
cache_dir, format_control, {'binary'}
|
289 |
+
)
|
290 |
+
self._wheel_cache = SimpleWheelCache(cache_dir, format_control)
|
291 |
+
self._ephem_cache = EphemWheelCache(format_control)
|
292 |
+
|
293 |
+
def get_path_for_link_legacy(self, link):
|
294 |
+
# type: (Link) -> str
|
295 |
+
return self._wheel_cache.get_path_for_link_legacy(link)
|
296 |
+
|
297 |
+
def get_path_for_link(self, link):
|
298 |
+
# type: (Link) -> str
|
299 |
+
return self._wheel_cache.get_path_for_link(link)
|
300 |
+
|
301 |
+
def get_ephem_path_for_link(self, link):
|
302 |
+
# type: (Link) -> str
|
303 |
+
return self._ephem_cache.get_path_for_link(link)
|
304 |
+
|
305 |
+
def get(
|
306 |
+
self,
|
307 |
+
link, # type: Link
|
308 |
+
package_name, # type: Optional[str]
|
309 |
+
supported_tags, # type: List[Tag]
|
310 |
+
):
|
311 |
+
# type: (...) -> Link
|
312 |
+
retval = self._wheel_cache.get(
|
313 |
+
link=link,
|
314 |
+
package_name=package_name,
|
315 |
+
supported_tags=supported_tags,
|
316 |
+
)
|
317 |
+
if retval is not link:
|
318 |
+
return retval
|
319 |
+
|
320 |
+
return self._ephem_cache.get(
|
321 |
+
link=link,
|
322 |
+
package_name=package_name,
|
323 |
+
supported_tags=supported_tags,
|
324 |
+
)
|
325 |
+
|
326 |
+
def cleanup(self):
|
327 |
+
# type: () -> None
|
328 |
+
self._wheel_cache.cleanup()
|
329 |
+
self._ephem_cache.cleanup()
|
jax_env/lib/python3.8/site-packages/pip/_internal/cli/__init__.py
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
"""Subpackage containing all of pip's command line interface related code
|
2 |
+
"""
|
3 |
+
|
4 |
+
# This file intentionally does not import submodules
|
jax_env/lib/python3.8/site-packages/pip/_internal/cli/__pycache__/__init__.cpython-38.pyc
ADDED
Binary file (236 Bytes). View file
|
|