ai-edge-torch-nightly 0.5.0.dev20250520__py3-none-any.whl → 0.6.0.dev20250522__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ai_edge_torch/generative/examples/qwen/convert_v3_to_tflite.py +61 -0
- ai_edge_torch/generative/examples/qwen/qwen3.py +171 -0
- ai_edge_torch/generative/examples/qwen/{verify.py → verify_qwen2.py} +1 -0
- ai_edge_torch/generative/examples/qwen/verify_qwen3.py +59 -0
- ai_edge_torch/generative/examples/qwen/verify_util.py +15 -3
- ai_edge_torch/generative/utilities/converter.py +5 -5
- ai_edge_torch/generative/utilities/export_config.py +5 -0
- ai_edge_torch/generative/utilities/loader.py +3 -3
- ai_edge_torch/generative/utilities/transformers_verifier.py +5 -3
- ai_edge_torch/version.py +1 -1
- {ai_edge_torch_nightly-0.5.0.dev20250520.dist-info → ai_edge_torch_nightly-0.6.0.dev20250522.dist-info}/METADATA +1 -1
- {ai_edge_torch_nightly-0.5.0.dev20250520.dist-info → ai_edge_torch_nightly-0.6.0.dev20250522.dist-info}/RECORD +15 -12
- {ai_edge_torch_nightly-0.5.0.dev20250520.dist-info → ai_edge_torch_nightly-0.6.0.dev20250522.dist-info}/LICENSE +0 -0
- {ai_edge_torch_nightly-0.5.0.dev20250520.dist-info → ai_edge_torch_nightly-0.6.0.dev20250522.dist-info}/WHEEL +0 -0
- {ai_edge_torch_nightly-0.5.0.dev20250520.dist-info → ai_edge_torch_nightly-0.6.0.dev20250522.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
# Copyright 2025 The AI Edge Torch Authors.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
# ==============================================================================
|
15
|
+
|
16
|
+
"""Example of converting Qwen 3.0 models to multi-signature tflite model."""
|
17
|
+
|
18
|
+
from absl import app
|
19
|
+
from ai_edge_torch.generative.examples.qwen import qwen3
|
20
|
+
from ai_edge_torch.generative.utilities import converter
|
21
|
+
from ai_edge_torch.generative.utilities import export_config
|
22
|
+
from ai_edge_torch.generative.utilities import loader
|
23
|
+
|
24
|
+
flags = converter.define_conversion_flags('qwen')
|
25
|
+
|
26
|
+
_MODEL_SIZE = flags.DEFINE_enum(
|
27
|
+
'model_size',
|
28
|
+
'1.7b',
|
29
|
+
['0.6b', '1.7b', '4b'],
|
30
|
+
'The size of the model to convert.',
|
31
|
+
)
|
32
|
+
|
33
|
+
_BUILDER = {
|
34
|
+
'0.6b': qwen3.build_0_6b_model,
|
35
|
+
'1.7b': qwen3.build_1_7b_model,
|
36
|
+
'4b': qwen3.build_4b_model,
|
37
|
+
}
|
38
|
+
|
39
|
+
|
40
|
+
def main(_):
|
41
|
+
checkpoint_path = flags.FLAGS.checkpoint_path
|
42
|
+
pytorch_model = _BUILDER[_MODEL_SIZE.value](
|
43
|
+
checkpoint_path,
|
44
|
+
custom_loader=loader.maybe_get_custom_loader(
|
45
|
+
checkpoint_path, flags.FLAGS.custom_checkpoint_loader
|
46
|
+
),
|
47
|
+
kv_cache_max_len=flags.FLAGS.kv_cache_max_len,
|
48
|
+
)
|
49
|
+
converter.convert_to_tflite(
|
50
|
+
pytorch_model,
|
51
|
+
output_path=flags.FLAGS.output_path,
|
52
|
+
output_name_prefix=flags.FLAGS.output_name_prefix,
|
53
|
+
prefill_seq_len=flags.FLAGS.prefill_seq_lens,
|
54
|
+
quantize=flags.FLAGS.quantize,
|
55
|
+
lora_ranks=flags.FLAGS.lora_ranks,
|
56
|
+
export_config=export_config.get_from_flags(),
|
57
|
+
)
|
58
|
+
|
59
|
+
|
60
|
+
if __name__ == '__main__':
|
61
|
+
app.run(main)
|
@@ -0,0 +1,171 @@
|
|
1
|
+
# Copyright 2025 The AI Edge Torch Authors.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
# ==============================================================================
|
15
|
+
|
16
|
+
"""Example of building Qwen 3.0 models."""
|
17
|
+
|
18
|
+
from typing import Callable, Dict
|
19
|
+
import ai_edge_torch.generative.layers.model_config as cfg
|
20
|
+
from ai_edge_torch.generative.utilities import loader as loading_utils
|
21
|
+
from ai_edge_torch.generative.utilities import model_builder
|
22
|
+
import torch
|
23
|
+
from torch import nn
|
24
|
+
|
25
|
+
TENSOR_NAMES = loading_utils.ModelLoader.TensorNames(
|
26
|
+
ff_up_proj="model.layers.{}.mlp.up_proj",
|
27
|
+
ff_down_proj="model.layers.{}.mlp.down_proj",
|
28
|
+
ff_gate_proj="model.layers.{}.mlp.gate_proj",
|
29
|
+
attn_query_proj="model.layers.{}.self_attn.q_proj",
|
30
|
+
attn_key_proj="model.layers.{}.self_attn.k_proj",
|
31
|
+
attn_value_proj="model.layers.{}.self_attn.v_proj",
|
32
|
+
attn_query_norm="model.layers.{}.self_attn.q_norm",
|
33
|
+
attn_key_norm="model.layers.{}.self_attn.k_norm",
|
34
|
+
attn_output_proj="model.layers.{}.self_attn.o_proj",
|
35
|
+
pre_attn_norm="model.layers.{}.input_layernorm",
|
36
|
+
post_attn_norm="model.layers.{}.post_attention_layernorm",
|
37
|
+
embedding="model.embed_tokens",
|
38
|
+
final_norm="model.norm",
|
39
|
+
lm_head="lm_head",
|
40
|
+
)
|
41
|
+
|
42
|
+
|
43
|
+
class Qwen3(model_builder.DecoderOnlyModel):
|
44
|
+
"""A Qwen3 model built from the Edge Generative API layers."""
|
45
|
+
|
46
|
+
pass
|
47
|
+
|
48
|
+
|
49
|
+
def get_4b_model_config(kv_cache_max_len: int = 1024) -> cfg.ModelConfig:
|
50
|
+
"""Returns the model config for a Qwen 3.0 4B model.
|
51
|
+
|
52
|
+
Args:
|
53
|
+
kv_cache_max_len (int): The maximum sequence length of the KV cache. Default
|
54
|
+
is 1024.
|
55
|
+
|
56
|
+
Returns:
|
57
|
+
The model config for a SmolLM model.
|
58
|
+
"""
|
59
|
+
norm_config = cfg.NormalizationConfig(
|
60
|
+
type=cfg.NormalizationType.RMS_NORM, epsilon=1e-06
|
61
|
+
)
|
62
|
+
attn_config = cfg.AttentionConfig(
|
63
|
+
num_heads=32,
|
64
|
+
head_dim=128,
|
65
|
+
num_query_groups=8,
|
66
|
+
query_norm_config=norm_config,
|
67
|
+
key_norm_config=norm_config,
|
68
|
+
rotary_base=1000000,
|
69
|
+
rotary_percentage=1.0,
|
70
|
+
qkv_use_bias=False,
|
71
|
+
qkv_transpose_before_split=True,
|
72
|
+
qkv_fused_interleaved=False, # No interleaved qkv projection.
|
73
|
+
)
|
74
|
+
ff_config = cfg.FeedForwardConfig(
|
75
|
+
type=cfg.FeedForwardType.GATED,
|
76
|
+
activation=cfg.ActivationConfig(cfg.ActivationType.SILU),
|
77
|
+
intermediate_size=9728,
|
78
|
+
)
|
79
|
+
block_config = cfg.TransformerBlockConfig(
|
80
|
+
attn_config=attn_config,
|
81
|
+
ff_config=ff_config,
|
82
|
+
pre_attention_norm_config=norm_config,
|
83
|
+
post_attention_norm_config=norm_config,
|
84
|
+
)
|
85
|
+
config = cfg.ModelConfig(
|
86
|
+
vocab_size=151936,
|
87
|
+
num_layers=36,
|
88
|
+
max_seq_len=40960,
|
89
|
+
embedding_dim=2560,
|
90
|
+
kv_cache_max_len=kv_cache_max_len,
|
91
|
+
block_configs=block_config,
|
92
|
+
final_norm_config=norm_config,
|
93
|
+
)
|
94
|
+
return config
|
95
|
+
|
96
|
+
|
97
|
+
def get_1_7b_model_config(kv_cache_max_len: int = 1024) -> cfg.ModelConfig:
|
98
|
+
"""Returns the model config for a Qwen 3.0 1.7B model."""
|
99
|
+
config = get_4b_model_config(kv_cache_max_len)
|
100
|
+
# Qwen has only one block config.
|
101
|
+
block_config = config.block_config(0)
|
102
|
+
block_config.attn_config.num_heads = 16
|
103
|
+
block_config.attn_config.head_dim = 128
|
104
|
+
block_config.ff_config.intermediate_size = 6144
|
105
|
+
config.num_layers = 28
|
106
|
+
config.embedding_dim = 2048
|
107
|
+
return config
|
108
|
+
|
109
|
+
|
110
|
+
def get_0_6b_model_config(kv_cache_max_len: int = 1024) -> cfg.ModelConfig:
|
111
|
+
"""Returns the model config for a Qwen 3.0 0.6B model."""
|
112
|
+
config = get_4b_model_config(kv_cache_max_len)
|
113
|
+
# Qwen has only one block config.
|
114
|
+
block_config = config.block_config(0)
|
115
|
+
block_config.attn_config.num_heads = 16
|
116
|
+
block_config.attn_config.head_dim = 128
|
117
|
+
block_config.ff_config.intermediate_size = 3072
|
118
|
+
config.num_layers = 28
|
119
|
+
config.embedding_dim = 1024
|
120
|
+
return config
|
121
|
+
|
122
|
+
|
123
|
+
def get_fake_model_config(**kwargs) -> cfg.ModelConfig:
|
124
|
+
config = get_4b_model_config(**kwargs)
|
125
|
+
config.vocab_size = 128
|
126
|
+
config.num_layers = 2
|
127
|
+
# Qwen has only one block config.
|
128
|
+
config.block_config(0).ff_config.intermediate_size = 64
|
129
|
+
return config
|
130
|
+
|
131
|
+
|
132
|
+
def build_4b_model(
|
133
|
+
checkpoint_path: str,
|
134
|
+
custom_loader: Callable[[str], Dict[str, torch.Tensor]] = None,
|
135
|
+
**kwargs
|
136
|
+
) -> nn.Module:
|
137
|
+
return model_builder.build_decoder_only_model(
|
138
|
+
checkpoint_path=checkpoint_path,
|
139
|
+
config=get_4b_model_config(**kwargs),
|
140
|
+
tensor_names=TENSOR_NAMES,
|
141
|
+
model_class=Qwen3,
|
142
|
+
custom_loader=custom_loader,
|
143
|
+
)
|
144
|
+
|
145
|
+
|
146
|
+
def build_1_7b_model(
|
147
|
+
checkpoint_path: str,
|
148
|
+
custom_loader: Callable[[str], Dict[str, torch.Tensor]] = None,
|
149
|
+
**kwargs
|
150
|
+
) -> nn.Module:
|
151
|
+
return model_builder.build_decoder_only_model(
|
152
|
+
checkpoint_path=checkpoint_path,
|
153
|
+
config=get_1_7b_model_config(**kwargs),
|
154
|
+
tensor_names=TENSOR_NAMES,
|
155
|
+
model_class=Qwen3,
|
156
|
+
custom_loader=custom_loader,
|
157
|
+
)
|
158
|
+
|
159
|
+
|
160
|
+
def build_0_6b_model(
|
161
|
+
checkpoint_path: str,
|
162
|
+
custom_loader: Callable[[str], Dict[str, torch.Tensor]] = None,
|
163
|
+
**kwargs
|
164
|
+
) -> nn.Module:
|
165
|
+
return model_builder.build_decoder_only_model(
|
166
|
+
checkpoint_path=checkpoint_path,
|
167
|
+
config=get_0_6b_model_config(**kwargs),
|
168
|
+
tensor_names=TENSOR_NAMES,
|
169
|
+
model_class=Qwen3,
|
170
|
+
custom_loader=custom_loader,
|
171
|
+
)
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Copyright 2025 The AI Edge Torch Authors.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
# ==============================================================================
|
15
|
+
|
16
|
+
"""Verifies the reauthored Qwen 3.0 0.6B, 1.7B, and 4B models."""
|
17
|
+
|
18
|
+
|
19
|
+
from absl import app
|
20
|
+
from absl import flags
|
21
|
+
from ai_edge_torch.generative.examples.qwen import verify_util
|
22
|
+
|
23
|
+
|
24
|
+
_MODEL_SIZE = flags.DEFINE_enum(
|
25
|
+
"model_size",
|
26
|
+
"0.6b",
|
27
|
+
["0.6b", "1.7b", "4b"],
|
28
|
+
"The size of the model to verify.",
|
29
|
+
)
|
30
|
+
_PROMPTS = flags.DEFINE_multi_string(
|
31
|
+
"prompts",
|
32
|
+
"What is the meaning of life?",
|
33
|
+
"The input prompts to generate answers.",
|
34
|
+
)
|
35
|
+
_MAX_NEW_TOKENS = flags.DEFINE_integer(
|
36
|
+
"max_new_tokens",
|
37
|
+
30,
|
38
|
+
"The maximum size of the generated tokens.",
|
39
|
+
)
|
40
|
+
|
41
|
+
_CHECKPOINT = {
|
42
|
+
"0.6b": "Qwen/Qwen3-0.6B",
|
43
|
+
"1.7b": "Qwen/Qwen3-1.7B",
|
44
|
+
"4b": "Qwen/Qwen3-4B",
|
45
|
+
}
|
46
|
+
|
47
|
+
|
48
|
+
def main(_):
|
49
|
+
verify_util.verify_qwen(
|
50
|
+
model_size=_MODEL_SIZE.value,
|
51
|
+
model_version="v3",
|
52
|
+
checkpoint_dir=_CHECKPOINT[_MODEL_SIZE.value],
|
53
|
+
max_new_tokens=_MAX_NEW_TOKENS.value,
|
54
|
+
prompts=_PROMPTS.value,
|
55
|
+
)
|
56
|
+
|
57
|
+
|
58
|
+
if __name__ == "__main__":
|
59
|
+
app.run(main)
|
@@ -17,24 +17,36 @@ import logging
|
|
17
17
|
import os
|
18
18
|
import pathlib
|
19
19
|
|
20
|
-
from ai_edge_torch.generative.examples.qwen import qwen
|
20
|
+
from ai_edge_torch.generative.examples.qwen import qwen, qwen3
|
21
21
|
from ai_edge_torch.generative.utilities import loader
|
22
22
|
from ai_edge_torch.generative.utilities import transformers_verifier
|
23
23
|
from ai_edge_torch.generative.utilities import verifier
|
24
24
|
import transformers
|
25
25
|
|
26
26
|
|
27
|
-
|
27
|
+
_BUILDER_V2 = {
|
28
28
|
"0.5b": qwen.build_0_5b_model,
|
29
29
|
"1.5b": qwen.build_1_5b_model,
|
30
30
|
"3b": qwen.build_3b_model,
|
31
31
|
}
|
32
32
|
|
33
|
+
_BUILDER_V3 = {
|
34
|
+
"0.6b": qwen3.build_0_6b_model,
|
35
|
+
"1.7b": qwen3.build_1_7b_model,
|
36
|
+
"4b": qwen3.build_4b_model,
|
37
|
+
}
|
38
|
+
|
39
|
+
_BUILDER = {
|
40
|
+
"v2": _BUILDER_V2,
|
41
|
+
"v3": _BUILDER_V3,
|
42
|
+
}
|
43
|
+
|
33
44
|
DEFAULT_PROMPTS = ["What is the meaning of life?"]
|
34
45
|
|
35
46
|
|
36
47
|
def verify_qwen(
|
37
48
|
model_size: str,
|
49
|
+
model_version: str,
|
38
50
|
checkpoint_dir: str,
|
39
51
|
weight_filename: str = "model.safetensors",
|
40
52
|
max_new_tokens: int = 30,
|
@@ -64,7 +76,7 @@ def verify_qwen(
|
|
64
76
|
reauthored_checkpoint = os.path.join(checkpoint_dir, weight_filename)
|
65
77
|
|
66
78
|
logging.info("Building the reauthored model from: %s", reauthored_checkpoint)
|
67
|
-
reauthored_model = _BUILDER[model_size](
|
79
|
+
reauthored_model = _BUILDER[model_version][model_size](
|
68
80
|
checkpoint_path=reauthored_checkpoint,
|
69
81
|
custom_loader=custom_loader,
|
70
82
|
)
|
@@ -350,10 +350,10 @@ def _export_helper(
|
|
350
350
|
)
|
351
351
|
|
352
352
|
prefill_masks = None
|
353
|
-
if
|
353
|
+
if export_config.mask_as_input:
|
354
354
|
prefill_masks = _build_mask(
|
355
|
-
|
356
|
-
|
355
|
+
prefill_seq_lens,
|
356
|
+
config.kv_cache_max_len,
|
357
357
|
config.causal_mask_value,
|
358
358
|
)
|
359
359
|
if not isinstance(prefill_masks, list):
|
@@ -424,7 +424,7 @@ def _export_helper(
|
|
424
424
|
'input_pos': decode_input_pos,
|
425
425
|
'kv_cache': decode_kv,
|
426
426
|
}
|
427
|
-
if
|
427
|
+
if export_config.mask_as_input:
|
428
428
|
# Note that the decode mask is not a correct causal mask, but it is okay
|
429
429
|
# for the conversion purpose because only the shape matters in conversion.
|
430
430
|
# A correct causal mask of decode for a given token position of decode, it
|
@@ -433,7 +433,7 @@ def _export_helper(
|
|
433
433
|
# torch.triu(mask, diagonal=decode_position).unsqueeze(0).unsqueeze(0)
|
434
434
|
#
|
435
435
|
sample_kwargs['mask'] = _build_mask(
|
436
|
-
1,
|
436
|
+
1, config.kv_cache_max_len, config.causal_mask_value
|
437
437
|
)
|
438
438
|
if lora is not None:
|
439
439
|
sample_kwargs['lora'] = lora
|
@@ -43,6 +43,9 @@ class ExportConfig:
|
|
43
43
|
kvcache_cls: type = kv_utils.KVCache
|
44
44
|
# The batch size of the decode signature.
|
45
45
|
decode_batch_size: int = 1
|
46
|
+
# If true, the mask will be passed in as input. Otherwise, mask will be
|
47
|
+
# built by the model internally.
|
48
|
+
mask_as_input: bool = False
|
46
49
|
|
47
50
|
|
48
51
|
def get_from_flags() -> ExportConfig:
|
@@ -51,5 +54,7 @@ def get_from_flags() -> ExportConfig:
|
|
51
54
|
|
52
55
|
if flags.FLAGS.transpose_kv_cache:
|
53
56
|
export_config.kvcache_layout = kv_utils.KV_LAYOUT_TRANSPOSED
|
57
|
+
if flags.FLAGS.mask_as_input:
|
58
|
+
export_config.mask_as_input = flags.FLAGS.mask_as_input
|
54
59
|
|
55
60
|
return export_config
|
@@ -19,8 +19,8 @@ import os
|
|
19
19
|
from typing import Callable, Dict, List, Optional, Tuple
|
20
20
|
|
21
21
|
from ai_edge_torch.generative.layers import model_config
|
22
|
-
import safetensors
|
23
22
|
from safetensors import safe_open
|
23
|
+
from safetensors.torch import load_file
|
24
24
|
import torch
|
25
25
|
|
26
26
|
|
@@ -47,7 +47,7 @@ def get_custom_loader(
|
|
47
47
|
|
48
48
|
if checkpoint_format:
|
49
49
|
if checkpoint_format == "safetensors":
|
50
|
-
return
|
50
|
+
return load_file
|
51
51
|
if checkpoint_format == "pt":
|
52
52
|
return lambda path: torch.load(path, weights_only=True)
|
53
53
|
raise ValueError(f"Unsupported checkpoint format: {checkpoint_format}")
|
@@ -55,7 +55,7 @@ def get_custom_loader(
|
|
55
55
|
if os.path.splitext(checkpoint_path)[1] in [".bin", ".pt", ".ckpt"]:
|
56
56
|
return lambda path: torch.load(path, weights_only=True)
|
57
57
|
if checkpoint_path.endswith(".safetensors"):
|
58
|
-
return
|
58
|
+
return load_file
|
59
59
|
raise ValueError(f"Unsupported checkpoint format: {checkpoint_path}")
|
60
60
|
|
61
61
|
|
@@ -15,8 +15,6 @@
|
|
15
15
|
|
16
16
|
"""Utilities for the models predefined in HuggingFace transformers."""
|
17
17
|
|
18
|
-
from typing import cast
|
19
|
-
|
20
18
|
from ai_edge_torch.generative.utilities import verifier
|
21
19
|
import torch
|
22
20
|
import transformers
|
@@ -39,4 +37,8 @@ class TransformersModelWrapper(verifier.ModelWrapper):
|
|
39
37
|
self, inputs: torch.Tensor, max_new_tokens: int
|
40
38
|
) -> torch.IntTensor:
|
41
39
|
gen_config = transformers.GenerationConfig(max_new_tokens=max_new_tokens)
|
42
|
-
|
40
|
+
# Do not override GenerationConfig with model defaults. Always keep greedy
|
41
|
+
# sampling.
|
42
|
+
return self.model.generate(
|
43
|
+
inputs=inputs, generation_config=gen_config, use_model_defaults=False
|
44
|
+
)
|
ai_edge_torch/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ai-edge-torch-nightly
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.6.0.dev20250522
|
4
4
|
Summary: Supporting PyTorch models with the Google AI Edge TFLite runtime.
|
5
5
|
Home-page: https://github.com/google-ai-edge/ai-edge-torch
|
6
6
|
Keywords: On-Device ML,AI,Google,TFLite,PyTorch,LLMs,GenAI
|
@@ -2,7 +2,7 @@ ai_edge_torch/__init__.py,sha256=lemyLCNoGYRnJsmDuGZu7qOqLbLqG6CGDFtu3ue1syU,129
|
|
2
2
|
ai_edge_torch/_config.py,sha256=AiqhbcheF7j_ozIGDLC89k1we95aVgFDa-tR6h7UI0s,2529
|
3
3
|
ai_edge_torch/conftest.py,sha256=r0GTrhMRhlmOGrrkvumHN8hkmyug6WvF60vWq8wRIBI,758
|
4
4
|
ai_edge_torch/model.py,sha256=wxjSFq_rBSxSqbUE8E8EJTCkgvgaRLjq_ZuAM-IZpCU,5606
|
5
|
-
ai_edge_torch/version.py,sha256=
|
5
|
+
ai_edge_torch/version.py,sha256=khTRYaBBm9J5iM-bJK8PgD2F4rAYy3w4cGEKRbQ498M,706
|
6
6
|
ai_edge_torch/_convert/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
7
7
|
ai_edge_torch/_convert/conversion.py,sha256=iQk3R-pLq4c1nfLqPB4xTRj78gghxPGzJCJtILLdg5o,6123
|
8
8
|
ai_edge_torch/_convert/conversion_utils.py,sha256=Sr8qXVcTwc-ZnZmK7yxVrIOOp1S_vNrwzC0zUvLTI2o,2160
|
@@ -118,9 +118,12 @@ ai_edge_torch/generative/examples/phi/verify_phi4.py,sha256=2MlgQrfRkhE7Dya8MIix
|
|
118
118
|
ai_edge_torch/generative/examples/phi/verify_util.py,sha256=kRREOMSikn_BRbTDkQiXBllPZwmWHa9KUk-kK5lCkbU,2945
|
119
119
|
ai_edge_torch/generative/examples/qwen/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
120
120
|
ai_edge_torch/generative/examples/qwen/convert_to_tflite.py,sha256=TnzyARHQgmWeOdYsV9WpRj5vhKGBH0kAbp3tMj8ZCYw,1998
|
121
|
+
ai_edge_torch/generative/examples/qwen/convert_v3_to_tflite.py,sha256=GVV8CVj3rdgt_ZTOlpLSa6AD1pMMpMnZEuowzN2AIGM,2004
|
121
122
|
ai_edge_torch/generative/examples/qwen/qwen.py,sha256=EcIHVeBcJLc290TiPkPfE7jdG_VXZYKlVGf0XQXzqo8,4554
|
122
|
-
ai_edge_torch/generative/examples/qwen/
|
123
|
-
ai_edge_torch/generative/examples/qwen/
|
123
|
+
ai_edge_torch/generative/examples/qwen/qwen3.py,sha256=g6aVHjnlPo4YhLjSdXxONaDcKT3fZOh8cewlvf3cfoQ,5554
|
124
|
+
ai_edge_torch/generative/examples/qwen/verify_qwen2.py,sha256=ry-c2QesH-0KnrSQygfjUFs6d4kOFvJz2ts_8mP156I,1659
|
125
|
+
ai_edge_torch/generative/examples/qwen/verify_qwen3.py,sha256=hmE0gdyzgcDpEDcWiwOzKQcxt4XeAe9DPRspy_I-lc8,1628
|
126
|
+
ai_edge_torch/generative/examples/qwen/verify_util.py,sha256=vPROwLRABTChMGo5yWJkZURXP6TKWgh5FJj1Z3Zs6HU,3153
|
124
127
|
ai_edge_torch/generative/examples/qwen_vl/__init__.py,sha256=JaAnrFoXTl3RJX97XspklkTyqOHVyAgRJsZtzNDd10c,671
|
125
128
|
ai_edge_torch/generative/examples/qwen_vl/convert_to_tflite.py,sha256=BM-ed7KrmPwzI3MvDs2R7P-kJgE1SK_cNVqIfXhtJjs,2411
|
126
129
|
ai_edge_torch/generative/examples/qwen_vl/decoder.py,sha256=plOi-3LltxReW_HVxhxwee_rYCQq-gsOwbGZtRsM8N8,4443
|
@@ -205,14 +208,14 @@ ai_edge_torch/generative/test/test_model_conversion_large.py,sha256=vQWmpzMkJ2hP
|
|
205
208
|
ai_edge_torch/generative/test/test_quantize.py,sha256=kKJ01wscTC2t_Ylr7huO5gNKES01gm3dT1gx52z15PA,7356
|
206
209
|
ai_edge_torch/generative/test/utils.py,sha256=tF6aCfAGJnc9dmzCnZCEOuKNVimfWOqscv9og0DDLHU,2656
|
207
210
|
ai_edge_torch/generative/utilities/__init__.py,sha256=-_jxnnFnCgnTU4oTm4MnRsvL5lqhomBNdFBbqfmfHPo,720
|
208
|
-
ai_edge_torch/generative/utilities/converter.py,sha256=
|
209
|
-
ai_edge_torch/generative/utilities/export_config.py,sha256=
|
210
|
-
ai_edge_torch/generative/utilities/loader.py,sha256=
|
211
|
+
ai_edge_torch/generative/utilities/converter.py,sha256=DuoPb8Uhbxa32uUvr6grV5lssmUJdx298QwYz8cG_1Y,15512
|
212
|
+
ai_edge_torch/generative/utilities/export_config.py,sha256=qjkEbjcvi2AgQikZS5qfgR95Z5z9pm07KX-RN5ibfNE,2280
|
213
|
+
ai_edge_torch/generative/utilities/loader.py,sha256=oGgEc2tHRsVqSN3mgvcngXQrpV0a7cwTpJ3LmMVnyF0,15954
|
211
214
|
ai_edge_torch/generative/utilities/model_builder.py,sha256=tBfOcsI_NcneggHqkCSydYN3ZgmkzPc6nW0AJrA81wI,6461
|
212
215
|
ai_edge_torch/generative/utilities/moonshine_loader.py,sha256=_RpFabSqtGH5PHiP3_1f6QfO14qMADUxr_HGRlVDFB0,4891
|
213
216
|
ai_edge_torch/generative/utilities/stable_diffusion_loader.py,sha256=dqPD9qRXEWtU3ombslOC-BE2l_dMwHoCNu7NsIJhsso,36158
|
214
217
|
ai_edge_torch/generative/utilities/t5_loader.py,sha256=tEsfy8-ymzbbjOIc-oesXF3yGyyWtJgFXn2s7VOavt8,16961
|
215
|
-
ai_edge_torch/generative/utilities/transformers_verifier.py,sha256=
|
218
|
+
ai_edge_torch/generative/utilities/transformers_verifier.py,sha256=l54bmmhj613eB2oCoONIAKEHhf8TQOhC9Gwjp6lxHAE,1659
|
216
219
|
ai_edge_torch/generative/utilities/types.py,sha256=gZI9hIPB3XAo4oecKIIoVDfiyibLaSNFhecPFx4VDTM,2913
|
217
220
|
ai_edge_torch/generative/utilities/verifier.py,sha256=ETO2ShU5KXG7MLP8eVOWuzuRLCUtapafYHcZ6TZHIkw,13061
|
218
221
|
ai_edge_torch/hlfb/__init__.py,sha256=sH4um75na-O8tzxN6chFyp6Y4xnexsE7kUQpZySv6dE,735
|
@@ -264,8 +267,8 @@ ai_edge_torch/testing/__init__.py,sha256=_yGgvnBZWb7T3IN3mc4x1sS4vM96HZwM8pwIcPG
|
|
264
267
|
ai_edge_torch/testing/export.py,sha256=k5mGDGzwc23Z4zaIVDs8CNh-oOt64gsf9MS9NjhbPy4,3293
|
265
268
|
ai_edge_torch/testing/model_coverage/__init__.py,sha256=5P8J6Zk5YYtDvTBucFvB9NGSRI7Gw_24WnrbhXgycEE,765
|
266
269
|
ai_edge_torch/testing/model_coverage/model_coverage.py,sha256=UPB448aMDUyC0HNYVqio2rcJPnDN0tBQMP08J6vPYew,4718
|
267
|
-
ai_edge_torch_nightly-0.
|
268
|
-
ai_edge_torch_nightly-0.
|
269
|
-
ai_edge_torch_nightly-0.
|
270
|
-
ai_edge_torch_nightly-0.
|
271
|
-
ai_edge_torch_nightly-0.
|
270
|
+
ai_edge_torch_nightly-0.6.0.dev20250522.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
271
|
+
ai_edge_torch_nightly-0.6.0.dev20250522.dist-info/METADATA,sha256=4AO6S0O6AyT4GmWBjgWBjxRvbwD34vv4IoRR9kZW7V8,2074
|
272
|
+
ai_edge_torch_nightly-0.6.0.dev20250522.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
273
|
+
ai_edge_torch_nightly-0.6.0.dev20250522.dist-info/top_level.txt,sha256=5KXRaF2hwkApYxf7Y8y_tVb9aulGTlbOoNdbx1aKRkE,14
|
274
|
+
ai_edge_torch_nightly-0.6.0.dev20250522.dist-info/RECORD,,
|
File without changes
|
File without changes
|