-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgemma4.sh
More file actions
executable file
·41 lines (32 loc) · 1.61 KB
/
Copy pathgemma4.sh
File metadata and controls
executable file
·41 lines (32 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Copyright 2026 The LiteRT CLI Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# LiteRT CLI Gemma4 LLM Demo & Test Script
set -e
# Source shared utilities relative to script
source "$(dirname "${BASH_SOURCE[0]}")/../utils.sh"
setup_test_env "gemma4" "Gemma4 LLM Demo Script"
# --- 1. Convert HuggingFace Model google/gemma-4-E2B-it ---
# Wait for LiteRT Torch release.
# run_case "Convert: HuggingFace google/gemma-4-E2B-it" \
# litert convert google/gemma-4-E2B-it --output "models/gemma4"
# --- 2. Run Gemma4 Generative LLM Model ---
run_case "Run Gemma4: Generative inference with custom prompt" \
litert lm run --from-huggingface-repo=litert-community/gemma-4-E2B-it-litert-lm gemma-4-E2B-it.litertlm --prompt="What is the capital of France?"
# --- 3. Benchmark Gemma4 LLM Model ---
run_case "Benchmark Gemma4: Local benchmark of LLM generation" \
litert lm benchmark gemma-4-E2B-it.litertlm --from-huggingface-repo=litert-community/gemma-4-E2B-it-litert-lm -p 128 -d 128
# --- Summary Report ---
print_summary_report "Gemma4"