├── .allstar └── binary_artifacts.yaml ├── .github ├── labeler.yml └── workflows │ ├── labeler.yml │ ├── notebooks.yaml │ └── stale.yml ├── .gitignore ├── CONTRIBUTING.md ├── CodeGemma ├── README.md ├── [CodeGemma_1]Common_use_cases.ipynb └── [CodeGemma_1]Finetune_with_SQL.ipynb ├── Demos ├── Gemma-on-Android │ ├── Android_App │ │ ├── .gitignore │ │ ├── app │ │ │ ├── .gitignore │ │ │ ├── build.gradle.kts │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ ├── androidTest │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── scigemma │ │ │ │ │ └── ExampleInstrumentedTest.kt │ │ │ │ ├── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── scigemma │ │ │ │ │ │ ├── ChatMessage.kt │ │ │ │ │ │ ├── ChatScreen.kt │ │ │ │ │ │ ├── ChatUiState.kt │ │ │ │ │ │ ├── ChatViewModel.kt │ │ │ │ │ │ ├── InferenceModel.kt │ │ │ │ │ │ ├── LoadingScreen.kt │ │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ │ └── ui │ │ │ │ │ │ └── theme │ │ │ │ │ │ ├── Color.kt │ │ │ │ │ │ ├── Theme.kt │ │ │ │ │ │ └── Type.kt │ │ │ │ └── res │ │ │ │ │ ├── drawable │ │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ │ ├── ic_launcher_foreground.xml │ │ │ │ │ └── scigemmaicon.jpg │ │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── values │ │ │ │ │ ├── colors.xml │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── themes.xml │ │ │ │ │ └── xml │ │ │ │ │ ├── backup_rules.xml │ │ │ │ │ └── data_extraction_rules.xml │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── scigemma │ │ │ │ └── ExampleUnitTest.kt │ │ ├── build.gradle.kts │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── gradlew │ │ ├── gradlew.bat │ │ └── settings.gradle.kts │ ├── LICENSE │ ├── README.md │ └── assets │ │ ├── SciGemma.gif │ │ └── SciGemma_Pipeline.gif ├── Gemma-on-Cloudrun │ ├── Dockerfile │ ├── README.md │ ├── cloudbuild.yaml │ ├── code-examples │ │ ├── genai_examples.py │ │ ├── ollama_examples.py │ │ └── openai_examples.py │ ├── converter.go │ ├── converter_test.go │ ├── go.mod │ ├── proxy.go │ ├── proxy_test.go │ └── start_script.sh ├── PaliGemma-on-Android │ ├── Android_App │ │ └── PaliGemma │ │ │ ├── .gitignore │ │ │ ├── app │ │ │ ├── .gitignore │ │ │ ├── build.gradle.kts │ │ │ ├── proguard-rules.pro │ │ │ └── src │ │ │ │ ├── androidTest │ │ │ │ └── java │ │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── paligemma │ │ │ │ │ └── ExampleInstrumentedTest.kt │ │ │ │ ├── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── example │ │ │ │ │ │ └── paligemma │ │ │ │ │ │ ├── data │ │ │ │ │ │ ├── CoordinatesModel.kt │ │ │ │ │ │ ├── CoordinatesModelApi.kt │ │ │ │ │ │ ├── CoordinatesModelRepo.kt │ │ │ │ │ │ ├── CoordinatesModelRepoImpl.kt │ │ │ │ │ │ ├── InputStreamRequestBody.kt │ │ │ │ │ │ ├── RequestModel.kt │ │ │ │ │ │ └── Result.kt │ │ │ │ │ │ ├── presentation │ │ │ │ │ │ ├── CoordinatesModelViewModel.kt │ │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ │ └── UiState.kt │ │ │ │ │ │ └── ui │ │ │ │ │ │ └── theme │ │ │ │ │ │ ├── Color.kt │ │ │ │ │ │ ├── Theme.kt │ │ │ │ │ │ └── Type.kt │ │ │ │ └── res │ │ │ │ │ ├── drawable │ │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ │ ├── ic_launcher_foreground.xml │ │ │ │ │ └── paligemma_icon.jpg │ │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ │ ├── values │ │ │ │ │ ├── colors.xml │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── themes.xml │ │ │ │ │ └── xml │ │ │ │ │ ├── backup_rules.xml │ │ │ │ │ ├── data_extraction_rules.xml │ │ │ │ │ └── path_provider.xml │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── paligemma │ │ │ │ └── ExampleUnitTest.kt │ │ │ ├── build.gradle.kts │ │ │ ├── gradle.properties │ │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ │ ├── gradlew │ │ │ ├── gradlew.bat │ │ │ ├── paligemma.apk │ │ │ └── settings.gradle.kts │ ├── Python_Server │ │ ├── README.md │ │ ├── apiserver │ │ │ ├── api │ │ │ │ ├── __init__.py │ │ │ │ ├── admin.py │ │ │ │ ├── apps.py │ │ │ │ ├── migrations │ │ │ │ │ ├── 0001_initial.py │ │ │ │ │ └── __init__.py │ │ │ │ ├── models.py │ │ │ │ ├── schemas.py │ │ │ │ ├── test.py │ │ │ │ ├── tests.py │ │ │ │ ├── urls.py │ │ │ │ └── views.py │ │ │ ├── apiserver │ │ │ │ ├── __init__.py │ │ │ │ ├── asgi.py │ │ │ │ ├── media │ │ │ │ │ └── images │ │ │ │ │ │ └── image.jpg │ │ │ │ ├── settings.py │ │ │ │ ├── urls.py │ │ │ │ └── wsgi.py │ │ │ └── manage.py │ │ └── requirements.txt │ ├── README.md │ └── assets │ │ ├── paligemma-android-hf1.gif │ │ ├── paligemma-android-hf2.gif │ │ ├── paligemma-android-segmentation.gif │ │ └── paligemma_android_hf_pipeline.png ├── PaliGemma2-on-Web │ ├── README.md │ ├── assets │ │ ├── paligemma2-onnx-output.gif │ │ └── paligemma2-onnx-pipeline.png │ ├── package.json │ ├── public │ │ ├── index.html │ │ ├── script.js │ │ └── style.css │ └── server.js ├── README.md ├── business-email-assistant │ ├── LICENSE │ ├── README.md │ ├── email-processing-webapp │ │ ├── app.py │ │ ├── data │ │ │ └── email-001.txt │ │ ├── models │ │ │ ├── __init__.py │ │ │ ├── gemini.py │ │ │ └── gemma.py │ │ ├── run_app.sh │ │ ├── static │ │ │ ├── css │ │ │ │ └── style.css │ │ │ └── js │ │ │ │ └── script.js │ │ ├── templates │ │ │ └── index.html │ │ ├── tests │ │ │ ├── gemma_generate.sh │ │ │ └── web_app_test.sh │ │ └── weights │ │ │ ├── gemma2-2b_inquiry_tuned.lora.h5 │ │ │ └── readme.txt │ ├── installation.sh │ ├── model-tuning │ │ ├── README.md │ │ ├── data │ │ │ ├── record_1.json │ │ │ ├── record_2.json │ │ │ ├── record_3.json │ │ │ ├── record_4.json │ │ │ ├── record_4_2.json │ │ │ ├── record_5.json │ │ │ ├── record_5_2.json │ │ │ ├── record_6.json │ │ │ └── record_7.json.removed │ │ ├── deploy_weights.sh │ │ ├── main.py │ │ ├── notebook │ │ │ └── bakery_inquiry_model_tuned_with_gemma.ipynb │ │ ├── test_model.sh │ │ ├── tune_model.sh │ │ └── weights │ │ │ └── tuning-output-readme.txt │ ├── requirements.txt │ └── setup_python.sh ├── personal-code-assistant │ ├── README.md │ ├── gemma-web-service │ │ ├── README.md │ │ ├── gemma_service │ │ │ ├── gemma_model.py │ │ │ └── gemma_service_main.py │ │ ├── installation.sh │ │ ├── requirements.txt │ │ ├── run_service.sh │ │ ├── setup_python.sh │ │ └── tests │ │ │ ├── test_generation.sh │ │ │ └── test_post.sh │ └── pipet-code-agent-2 │ │ ├── .eslintrc.json │ │ ├── README.md │ │ ├── package-lock.json │ │ ├── package.json │ │ ├── src │ │ ├── comments.ts │ │ ├── extension.ts │ │ ├── models │ │ │ ├── gemini-api.ts │ │ │ └── gemma-service.ts │ │ ├── question.ts │ │ ├── review.ts │ │ └── utility │ │ │ └── commentChar.ts │ │ └── tsconfig.json └── spoken-language-tasks │ ├── LICENSE │ ├── installation.sh │ ├── k-gemma-it │ ├── README.md │ ├── deploy_weights.sh │ ├── main.py │ ├── spoken_language_tasks_with_gemma.ipynb │ ├── tune_model.sh │ └── weights │ │ └── tuning-output-readme.txt │ ├── k-mail-replier │ ├── README.md │ ├── k_mail_replier │ │ ├── __init__.py │ │ ├── app.py │ │ ├── data │ │ │ ├── email-001-ko.txt │ │ │ └── email-001.txt │ │ ├── models │ │ │ ├── __init__.py │ │ │ ├── gemini.py │ │ │ └── gemma.py │ │ ├── static │ │ │ ├── css │ │ │ │ └── style.css │ │ │ └── js │ │ │ │ └── script.js │ │ ├── templates │ │ │ └── index.html │ │ └── weights │ │ │ └── gemma2-2b_k-tuned.lora.h5 │ ├── run_flask_app.sh │ └── tests │ │ ├── __init__.py │ │ └── gemma_generate.sh │ ├── requirements.txt │ └── setup_python.sh ├── Gemma ├── README.md ├── [Gemma_1]Advanced_Prompting_Techniques.ipynb ├── [Gemma_1]Basics_with_HF.ipynb ├── [Gemma_1]Common_use_cases.ipynb ├── [Gemma_1]Finetune_distributed.ipynb ├── [Gemma_1]Finetune_with_LLaMA_Factory.ipynb ├── [Gemma_1]Finetune_with_XTuner.ipynb ├── [Gemma_1]Inference_on_TPU.ipynb ├── [Gemma_1]Minimal_RAG.ipynb ├── [Gemma_1]RAG_with_ChromaDB.ipynb ├── [Gemma_1]Using_with_Ollama.ipynb ├── [Gemma_1]Using_with_OneTwo.ipynb ├── [Gemma_1]data_parallel_inference_in_jax_tpu.ipynb ├── [Gemma_2]Agentic_AI.ipynb ├── [Gemma_2]Aligning_DPO.ipynb ├── [Gemma_2]Constrained_generation.ipynb ├── [Gemma_2]Custom_Vocabulary.ipynb ├── [Gemma_2]Deploy_in_Vertex_AI.ipynb ├── [Gemma_2]Deploy_with_vLLM.ipynb ├── [Gemma_2]Finetune_with_Axolotl.ipynb ├── [Gemma_2]Finetune_with_CALM.ipynb ├── [Gemma_2]Finetune_with_Function_Calling.ipynb ├── [Gemma_2]Finetune_with_JORA.ipynb ├── [Gemma_2]Finetune_with_LitGPT.ipynb ├── [Gemma_2]Finetune_with_Torch_XLA.ipynb ├── [Gemma_2]Finetune_with_Unsloth.ipynb ├── [Gemma_2]Function_Calling_with_Groq_Langchain.ipynb ├── [Gemma_2]Game_Design_Brainstorming.ipynb ├── [Gemma_2]Gradio_Chatbot.ipynb ├── [Gemma_2]Guess_the_word.ipynb ├── [Gemma_2]Keras_Quickstart.ipynb ├── [Gemma_2]Keras_Quickstart_Chat.ipynb ├── [Gemma_2]LangChain_chaining.ipynb ├── [Gemma_2]Prompt_chaining.ipynb ├── [Gemma_2]RAG_LlamaIndex.ipynb ├── [Gemma_2]RAG_PDF_Search_in_multiple_documents_on_Colab.ipynb ├── [Gemma_2]Synthetic_data_generation.ipynb ├── [Gemma_2]Translator_of_Old_Korean_Literature.ipynb ├── [Gemma_2]Using_Gemini_and_Gemma_with_RouteLLM.ipynb ├── [Gemma_2]Using_with_Elasticsearch_and_LangChain.ipynb ├── [Gemma_2]Using_with_Firebase_Genkit_and_Ollama.ipynb ├── [Gemma_2]Using_with_LLM_Comparator.ipynb ├── [Gemma_2]Using_with_LangChain.ipynb ├── [Gemma_2]Using_with_Langfun_and_LlamaCpp.ipynb ├── [Gemma_2]Using_with_Langfun_and_LlamaCpp_Python_Bindings.ipynb ├── [Gemma_2]Using_with_LlamaCpp.ipynb ├── [Gemma_2]Using_with_Llamafile.ipynb ├── [Gemma_2]Using_with_LocalGemma.ipynb ├── [Gemma_2]Using_with_Mesop.ipynb ├── [Gemma_2]Using_with_Ollama_Python.ipynb ├── [Gemma_2]Using_with_SGLang.ipynb ├── [Gemma_2]Using_with_Xinference.ipynb ├── [Gemma_2]Using_with_mistral_rs.ipynb ├── [Gemma_2]evaluation.ipynb ├── [Gemma_2]for_Japan_using_Transformers_and_PyTorch.ipynb ├── [Gemma_2]on_Groq.ipynb ├── [Gemma_3]Activation_Hacking.ipynb ├── [Gemma_3]Function_Calling_with_HF.ipynb ├── [Gemma_3]Function_Calling_with_HF_document_summarizer.ipynb ├── [Gemma_3]Inference_images_and_videos.ipynb ├── [Gemma_3]Local_Agentic_RAG.ipynb ├── [Gemma_3]Meme_Generator.ipynb ├── [Gemma_3]Using_with_Ollama_Python_Inference_with_Images.ipynb └── [Gemma_3]Using_with_Transformersjs.ipynb ├── LICENSE.txt ├── PaliGemma ├── README.md ├── [PaliGemma_1]Common_use_cases.ipynb ├── [PaliGemma_1]Finetune_with_Keras.ipynb ├── [PaliGemma_1]Finetune_with_image_captioning.ipynb ├── [PaliGemma_1]Finetune_with_image_description.ipynb ├── [PaliGemma_1]Finetune_with_object_detection.ipynb ├── [PaliGemma_1]Image_captioning.ipynb ├── [PaliGemma_1]Referring_expression_segmentation_in_images.ipynb ├── [PaliGemma_1]Referring_expression_segmentation_in_videos.ipynb ├── [PaliGemma_1]Using_with_Mesop.ipynb ├── [PaliGemma_1]Zero_shot_object_detection_in_images.ipynb ├── [PaliGemma_1]Zero_shot_object_detection_in_videos.ipynb ├── [PaliGemma_2]Convert_PaliGemma2_to_ONNX.ipynb ├── [PaliGemma_2]Finetune_with_JAX.ipynb ├── [PaliGemma_2]Finetune_with_Keras.ipynb ├── [PaliGemma_2]Inference_PaliGemma2_with_Transformers_js.ipynb ├── [PaliGemma_2]Keras_Quickstart.ipynb └── [PaliGemma_2]Using_with_Transformersjs.ipynb ├── README.md ├── TxGemma ├── README.md ├── [TxGemma]Agentic_Demo_with_Hugging_Face.ipynb ├── [TxGemma]Finetune_with_Hugging_Face.ipynb ├── [TxGemma]Quickstart_with_Hugging_Face.ipynb └── [TxGemma]Quickstart_with_Model_Garden.ipynb └── Workshops ├── README.md ├── Workshop_How_to_Fine_tuning_Gemma.ipynb ├── Workshop_How_to_Fine_tuning_Gemma_Transformers_Edition.ipynb ├── [Gemma_1]Self_extend.ipynb ├── [Gemma_2]control_vectors.ipynb └── jetson-nano.md /.allstar/binary_artifacts.yaml: -------------------------------------------------------------------------------- 1 | # Ignore reason: gradele jar file is used to build example Android app 2 | ignorePaths: 3 | - Demos/Gemma-on-Android/Android_App/gradle/wrapper/gradle-wrapper.jar 4 | - Demos/PaliGemma-on-Android/Android_App/PaliGemma/gradle/wrapper/gradle-wrapper.jar 5 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | 'status:awaiting review': 2 | - '**/*' -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | name: "PR Labeler" 2 | 3 | on: 4 | pull_request_target: 5 | types: ["opened", "reopened", "ready_for_review"] 6 | 7 | jobs: 8 | triage: 9 | permissions: 10 | contents: read 11 | pull-requests: write 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/labeler@v4 15 | if: ${{ github.event.pull_request.draft == false }} -------------------------------------------------------------------------------- /.github/workflows/notebooks.yaml: -------------------------------------------------------------------------------- 1 | # Notebook-related checks 2 | 3 | name: Notebooks 4 | 5 | on: 6 | # Relevant PRs 7 | pull_request: 8 | paths: 9 | - "**.ipynb" 10 | # Allow manual runs 11 | workflow_dispatch: 12 | 13 | jobs: 14 | # Format all notebooks. 15 | nbfmt: 16 | name: Notebook format 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v3 20 | - uses: actions/setup-python@v4 21 | - name: Install tensorflow-docs 22 | run: python3 -m pip install -U git+https://github.com/tensorflow/docs 23 | - name: Fetch main branch 24 | run: git fetch -u origin main:main 25 | - name: Check notebook formatting 26 | run: | 27 | if [ "${{ github.event_name }}" == "pull_request" ]; then 28 | # Only check notebooks modified in this pull request 29 | readarray -t changed_notebooks < <(git diff --name-only main --diff-filter="d" | grep '\.ipynb$' || true) 30 | else 31 | # Manual run, check everything 32 | readarray -t changed_notebooks < <(find -name '*.ipynb') 33 | fi 34 | if [[ ${#changed_notebooks[@]} == 0 ]]; then 35 | echo "No notebooks modified in this pull request." 36 | exit 0 37 | else 38 | echo "Check formatting with nbfmt:" 39 | python3 -m tensorflow_docs.tools.nbfmt --test "${changed_notebooks[@]}" 40 | fi 41 | 42 | nblint: 43 | name: Notebook lint 44 | runs-on: ubuntu-latest 45 | steps: 46 | - uses: actions/checkout@v3 47 | - uses: actions/setup-python@v4 48 | - name: Install tensorflow-docs 49 | run: python3 -m pip install -U git+https://github.com/tensorflow/docs 50 | - name: Fetch main branch 51 | run: git fetch -u origin main:main 52 | 53 | # Lint for all notebooks 54 | - name: Lint notebooks 55 | run: | 56 | if [ "${{ github.event_name }}" == "pull_request" ]; then 57 | # Only check notebooks modified in this pull request 58 | readarray -t changed_notebooks < <(git diff --name-only main --diff-filters="d" -- ":(exclude)TxGemma/" | grep '\.ipynb$' || true) 59 | else 60 | # Manual run, check everything 61 | readarray -t changed_notebooks < <(find . -name '*.ipynb') 62 | fi 63 | if [[ ${#changed_notebooks[@]} == 0 ]]; then 64 | echo "No website notebooks modified in this pull request." 65 | exit 0 66 | else 67 | echo "WARNING: If the button_colab check fails for you, make sure you have