mediapipe-nightly 0.10.10.post20240219__cp310-cp310-macosx_11_0_x86_64.whl → 0.10.10.post20240221__cp310-cp310-macosx_11_0_x86_64.whl

Sign up to get free protection for your applications and to get access to all the features.
mediapipe/__init__.py CHANGED
@@ -23,4 +23,4 @@ del modules
23
23
  del python
24
24
  del mediapipe
25
25
  del util
26
- __version__ = '0.10.10-20240219'
26
+ __version__ = '0.10.10-20240221'
@@ -22,7 +22,6 @@ from mediapipe.model_maker.python.vision import gesture_recognizer
22
22
  from mediapipe.model_maker.python.text import text_classifier
23
23
  from mediapipe.model_maker.python.vision import object_detector
24
24
  from mediapipe.model_maker.python.vision import face_stylizer
25
- from mediapipe.model_maker.python.llm import llm_converter
26
25
 
27
26
  # Remove duplicated and non-public API
28
27
  del python
@@ -107,6 +107,7 @@ def quantize_by_actions(
107
107
  )
108
108
  output_tensors[action.target_name] = (target_var, pack)
109
109
  output_tensors[action.target_name + '_quantized_scale'] = (scale, False)
110
+ zp = None
110
111
  else:
111
112
  target_var, scale, zp = quantization_util.quantize_tensor(
112
113
  var=action.tensor_value,
@@ -114,12 +115,13 @@ def quantize_by_actions(
114
115
  sym=is_symmetric,
115
116
  number_bits=action.quantize_bits,
116
117
  )
117
- if backend == 'cpu' and (action.quantize_bits == 4):
118
- target_var, scale, zp = quantization_util.update_to_uint4(
119
- target_var, scale, zp
120
- )
121
- output_tensors[action.target_name] = (target_var, pack)
122
- output_tensors[action.target_name + '_quantized_scale'] = (scale, False)
118
+ if backend == 'cpu' and pack:
119
+ target_var, scale, zp = quantization_util.update_to_uint4(
120
+ target_var, scale, zp
121
+ )
122
+ output_tensors[action.target_name] = (target_var, pack)
123
+ output_tensors[action.target_name + '_quantized_scale'] = (scale, False)
124
+ if zp is not None:
123
125
  output_tensors[action.target_name + '_quantized_zp'] = (zp, False)
124
126
  else:
125
127
  output_tensors[action.target_name] = (action.tensor_value, False)
@@ -170,7 +172,7 @@ def convert_checkpoint(config: ConversionConfig) -> None:
170
172
  """Converts the checkpoint to tflite file."""
171
173
  logging.info('input folder: %s', config.input_ckpt)
172
174
 
173
- if config.model_type == 'GEMMA_2B':
175
+ if config.model_type == 'GEMMA_2B' or config.model_type == 'GEMINI_XXS':
174
176
  vocab_model_path = config.vocab_model_file
175
177
  else:
176
178
  vocab_model_path = convert_bpe_vocab(
@@ -18,6 +18,7 @@ import contextlib
18
18
  import os
19
19
  from typing import Dict, Tuple
20
20
 
21
+ from jax import numpy as jnp
21
22
  import numpy as np
22
23
 
23
24
  from mediapipe.tasks.python.genai.converter import converter_base
@@ -65,7 +66,7 @@ class WeightBinsWriter(converter_base.ModelWriterBase):
65
66
  output = np.expand_dims(np.ravel(output), axis=-1)
66
67
  # Extra pack needed for 4 bit. We always pack the weights along the
67
68
  # first dimension since the tensor has already been squeezed.
68
- output = quantization_util.pack_4bit(output, 0)
69
+ output = quantization_util.pack_4bit(output, 0, jnp.int8)
69
70
  if 'combined_qkv' in var_name:
70
71
  var_name = removeprefix(var_name, 'mld_vars.')
71
72
  var_name_q = var_name.replace('combined_qkv', 'q')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mediapipe-nightly
3
- Version: 0.10.10.post20240219
3
+ Version: 0.10.10.post20240221
4
4
  Summary: MediaPipe is the simplest way for researchers and developers to build world-class ML solutions and applications for mobile, edge, cloud and the web.
5
5
  Home-page: https://github.com/google/mediapipe
6
6
  Author: The MediaPipe Authors
@@ -1,4 +1,4 @@
1
- mediapipe/__init__.py,sha256=2tmiU4WuedIsCWETIW7y0Ju2PlK3iUD4MD6strxoZK8,816
1
+ mediapipe/__init__.py,sha256=HMF8PlJekLmUJA-rh8bf9X9ODy9JqwX9L3rOdHZMLZg,816
2
2
  mediapipe/tasks/__init__.py,sha256=sVJS2p8J2PNVl8DLRPVY6KLpHenP_z3QVPRU0x_iL5g,571
3
3
  mediapipe/tasks/python/__init__.py,sha256=wIM_WOWboOVI1MeehN8fkN_DjoA0MEBVw5mShAd8AS4,858
4
4
  mediapipe/tasks/python/benchmark/__init__.py,sha256=epEucluzX0HinwBZoS7Tgb19j_qgfTuBf-vBkqemch8,587
@@ -90,9 +90,9 @@ mediapipe/tasks/python/genai/converter/converter_base.py,sha256=nRIhPYUg2pkUZcmw
90
90
  mediapipe/tasks/python/genai/converter/pytorch_converter.py,sha256=RiuCr2aXbZVn3Ssa3OcSx_RQK56rfZRCpvG7qYIji4w,10675
91
91
  mediapipe/tasks/python/genai/converter/__init__.py,sha256=jfUkinDJR5BVldnbJMbo5vIr2Xc5Z4TTnaCJTNoAUvg,893
92
92
  mediapipe/tasks/python/genai/converter/converter_factory.py,sha256=2K16PZBQym0WhXM2HOdBMHMugykohoD4OTaOIo-UKko,2928
93
- mediapipe/tasks/python/genai/converter/llm_converter.py,sha256=_S8fj-WAA6OMQFj_QZPChlfkJ4gp_DE2t8i4pwJAHjI,7782
93
+ mediapipe/tasks/python/genai/converter/llm_converter.py,sha256=srOhUwscJ6p4kICoi7bBdvkes5RvVfuHoUzh1HRsU6k,7827
94
94
  mediapipe/tasks/python/genai/converter/quantization_util_test.py,sha256=ICujhTFeREGuHGmNk1PlBpf1AUThFvv-Wl5UuZ-xWAk,9060
95
- mediapipe/tasks/python/genai/converter/weight_bins_writer.py,sha256=Ar8XBs1GhVSFObqN29K754iVZ_WSxe4k0Rty1a4vla0,4308
95
+ mediapipe/tasks/python/genai/converter/weight_bins_writer.py,sha256=qrsjTWw99u-VDNhtHbnbDfMypx4sGfGyY8mMBXYnQtA,4347
96
96
  mediapipe/tasks/python/metadata/metadata.py,sha256=EECQnM-Af0angD60jaBBOuNMgt7HExH6SqVtVMFNHGc,33763
97
97
  mediapipe/tasks/python/metadata/metadata_displayer_cli.py,sha256=tLhF0B1mXG0igFTA9nPh8t1efRpRw2hQ00XpTPYdk_o,1202
98
98
  mediapipe/tasks/python/metadata/__init__.py,sha256=YGHXQMz1ZGPcNgSXggu03b0USZKE8d9Xqvn6NDUl898,586
@@ -301,7 +301,7 @@ mediapipe/util/analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
301
301
  mediapipe/util/analytics/mediapipe_log_extension_pb2.py,sha256=UX1x8jckc8NQbUz-SXOKkb8co3JNIRX3rfaMs4_Dz8g,4319
302
302
  mediapipe/util/analytics/mediapipe_logging_enums_pb2.py,sha256=9pxs-DNSQnXQe7E_LKokGDbD_G1FpmzzJw1jzex78lU,3781
303
303
  mediapipe/python/solution_base.py,sha256=48PszV6dCssQUkyPBaqhqVehVjPtskawtGUc54k10DM,25624
304
- mediapipe/python/_framework_bindings.cpython-310-darwin.so,sha256=NNQX9AsJKv6ZkvmNq7RKTTvsMhGK0Fl04nC9yUW7y_w,78069939
304
+ mediapipe/python/_framework_bindings.cpython-310-darwin.so,sha256=dn6lDt-Pcnr-rqJmpf8QqwVG8-K-Lwy8rjmsycAYTw8,78070451
305
305
  mediapipe/python/timestamp_test.py,sha256=oWKTZMsV586jH57OBV30rihcymETyGC29VbYURNLJQQ,2528
306
306
  mediapipe/python/image_frame_test.py,sha256=ZSjdE-an2t8i6MiA4_Xri91VMH5_CCx45fjhWUQptMY,8602
307
307
  mediapipe/python/__init__.py,sha256=xTuq4e55ofMUGUpV81ZbVzYHmjMmzt9dBOfS4ugFN1c,1428
@@ -377,7 +377,7 @@ mediapipe/framework/stream_handler/fixed_size_input_stream_handler_pb2.py,sha256
377
377
  mediapipe/framework/stream_handler/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
378
378
  mediapipe/framework/stream_handler/timestamp_align_input_stream_handler_pb2.py,sha256=Te6j6EgjmL5w3qs4kk5SnkJILDkua9cNQM0GQfNv2PY,1604
379
379
  mediapipe/framework/stream_handler/sync_set_input_stream_handler_pb2.py,sha256=ld5VHlpCHO1NFaEjXMsRxAoiDKzsd1cvmQMTqTWcNwU,1811
380
- mediapipe/model_maker/__init__.py,sha256=iV39VJEvbJBXI4cjXxnfVrU5CTvUtNx3cPyhCoVQPk4,1212
380
+ mediapipe/model_maker/__init__.py,sha256=IswWcmeOPaRBNNdVp3K6m_ISXrI9_Enxnp-1kiaUEKs,1153
381
381
  mediapipe/model_maker/setup.py,sha256=GaOQVu7uTMp3gjpDHIVV45GEnLvSrgvg-BJoJAJXMbI,4064
382
382
  mediapipe/examples/__init__.py,sha256=bglKd2k2C7QGT1i-vstURXPJX2Cvq9FO9opr6cVeBp0,571
383
383
  mediapipe/examples/desktop/__init__.py,sha256=bglKd2k2C7QGT1i-vstURXPJX2Cvq9FO9opr6cVeBp0,571
@@ -559,8 +559,8 @@ mediapipe/modules/selfie_segmentation/selfie_segmentation.tflite,sha256=nuFo7HyP
559
559
  mediapipe/modules/palm_detection/palm_detection_full.tflite,sha256=GxTpQixq0AbN5lgaRsi5DdVzwHq385NLVYnnzqP4mlQ,2339846
560
560
  mediapipe/modules/palm_detection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
561
561
  mediapipe/modules/palm_detection/palm_detection_lite.tflite,sha256=6aSq3fkN2laocjUwPPAOTC0_socl9o_Yh3KZfayQXBg,1985440
562
- mediapipe_nightly-0.10.10.post20240219.dist-info/RECORD,,
563
- mediapipe_nightly-0.10.10.post20240219.dist-info/LICENSE,sha256=hwfu8FM5h-_FsVXWR2HutuIHk_ULm9Gmja0c9HGdDtg,12331
564
- mediapipe_nightly-0.10.10.post20240219.dist-info/WHEEL,sha256=M8b9ULkaMplgMtp3yPg8hIiqGMbYy3WJOJ_rS5NiMpg,111
565
- mediapipe_nightly-0.10.10.post20240219.dist-info/top_level.txt,sha256=LG-epD1oIiiHFRqLp--7jacjB3dbx2RfMcLYjCIhmxU,175
566
- mediapipe_nightly-0.10.10.post20240219.dist-info/METADATA,sha256=BBLlLK_MBEDboR4WEhiNqEiQWw7KF1RA6ohuuTA_3Kk,9672
562
+ mediapipe_nightly-0.10.10.post20240221.dist-info/RECORD,,
563
+ mediapipe_nightly-0.10.10.post20240221.dist-info/LICENSE,sha256=hwfu8FM5h-_FsVXWR2HutuIHk_ULm9Gmja0c9HGdDtg,12331
564
+ mediapipe_nightly-0.10.10.post20240221.dist-info/WHEEL,sha256=M8b9ULkaMplgMtp3yPg8hIiqGMbYy3WJOJ_rS5NiMpg,111
565
+ mediapipe_nightly-0.10.10.post20240221.dist-info/top_level.txt,sha256=LG-epD1oIiiHFRqLp--7jacjB3dbx2RfMcLYjCIhmxU,175
566
+ mediapipe_nightly-0.10.10.post20240221.dist-info/METADATA,sha256=n5NsAbtFC7eTYg8PVJytALqX5qMVya42iexL_nytaC4,9672