An error occurred: module 'mediapipe.python._framework_bindings.model_ckpt_util' has no attribute 'GenerateGpuTfLite' #5603
Labels
os:windows
MediaPipe issues on Windows
platform:python
MediaPipe Python issues
stat:awaiting googler
Waiting for Google Engineer's Response
task:LLM inference
Issues related to MediaPipe LLM Inference Gen AI setup
type:bug
Bug in the Source Code of MediaPipe Solution
I want to convert phi-2 model to MediaPipe format model by above link:
https://ai.google.dev/edge/mediapipe/solutions/genai/llm_inference#convert-model
But when I run it I encount the exception's error "An error occurred: module 'mediapipe.python._framework_bindings.model_ckpt_util' has no attribute 'GenerateGpuTfLite'", above is all my code:
import mediapipe as mp
from mediapipe.tasks.python.genai import converter
INPUT_CKPT = './content/phi-2/model*.safetensors'
CKPT_FORMAT = 'safetensors'
MODEL_TYPE = 'PHI_2'
BACKEND = 'cpu'
OUTPUT_DIR = './content/intermediate/phi-2/'
VOCAB_MODEL_FILE = './content/phi-2/tokenizer*.json'
OUTPUT_TFLITE_FILE = './content/converted_models/phi2_gpu.bin'
try:
config = converter.ConversionConfig(
input_ckpt=INPUT_CKPT,
ckpt_format=CKPT_FORMAT,
model_type=MODEL_TYPE,
backend=BACKEND,
output_dir=OUTPUT_DIR,
combine_file_only=False,
vocab_model_file=VOCAB_MODEL_FILE,
output_tflite_file=OUTPUT_TFLITE_FILE,
)
print(config)
converter.convert_checkpoint(config)
print(f"Model converted and saved to phi2_gpu.bin")
except Exception as e:
print(f"An error occurred: {e}")
Anybody can help me?
python: 3.9.19
mediapipe: 0.10.14
torch: 2.4.0+cu118
pip: 24.2
The text was updated successfully, but these errors were encountered: