Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	Add files
Browse files- .gitattributes +2 -0
- .pre-commit-config.yaml +33 -0
- .python-version +1 -0
- .vscode/extensions.json +8 -0
- .vscode/settings.json +17 -0
- app.py +198 -0
- assets/additional-examples/1.png +3 -0
- assets/additional-examples/2.png +3 -0
- assets/additional-examples/3.png +3 -0
- assets/additional-examples/4.png +3 -0
- assets/logo.png +3 -0
- assets/sample-images/01.png +3 -0
- assets/sample-images/02.png +3 -0
- assets/sample-images/03.png +3 -0
- assets/sample-images/04.png +3 -0
- assets/sample-images/05.png +3 -0
- assets/sample-images/06-1.png +3 -0
- assets/sample-images/06-2.png +3 -0
- assets/sample-images/07-1.png +3 -0
- assets/sample-images/07-2.png +3 -0
- assets/sample-images/07-3.png +3 -0
- assets/sample-images/07-4.png +3 -0
- assets/sample-images/08.png +3 -0
- assets/sample-images/09-1.png +3 -0
- assets/sample-images/09-2.png +3 -0
- assets/sample-images/09-3.png +3 -0
- assets/sample-images/09-4.png +3 -0
- assets/sample-images/09-5.png +3 -0
- assets/sample-images/10.png +3 -0
- assets/transformers-4.50.0.dev0-py3-none-any.whl +3 -0
- pyproject.toml +64 -0
- requirements.txt +229 -0
- style.css +11 -0
- uv.lock +0 -0
    	
        .gitattributes
    CHANGED
    
    | @@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text | |
| 33 | 
             
            *.zip filter=lfs diff=lfs merge=lfs -text
         | 
| 34 | 
             
            *.zst filter=lfs diff=lfs merge=lfs -text
         | 
| 35 | 
             
            *tfevents* filter=lfs diff=lfs merge=lfs -text
         | 
|  | |
|  | 
|  | |
| 33 | 
             
            *.zip filter=lfs diff=lfs merge=lfs -text
         | 
| 34 | 
             
            *.zst filter=lfs diff=lfs merge=lfs -text
         | 
| 35 | 
             
            *tfevents* filter=lfs diff=lfs merge=lfs -text
         | 
| 36 | 
            +
            *.png filter=lfs diff=lfs merge=lfs -text
         | 
| 37 | 
            +
            *.whl filter=lfs diff=lfs merge=lfs -text
         | 
    	
        .pre-commit-config.yaml
    ADDED
    
    | @@ -0,0 +1,33 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            repos:
         | 
| 2 | 
            +
              - repo: https://github.com/pre-commit/pre-commit-hooks
         | 
| 3 | 
            +
                rev: v5.0.0
         | 
| 4 | 
            +
                hooks:
         | 
| 5 | 
            +
                  - id: check-executables-have-shebangs
         | 
| 6 | 
            +
                  - id: check-json
         | 
| 7 | 
            +
                  - id: check-merge-conflict
         | 
| 8 | 
            +
                  - id: check-shebang-scripts-are-executable
         | 
| 9 | 
            +
                  - id: check-toml
         | 
| 10 | 
            +
                  - id: check-yaml
         | 
| 11 | 
            +
                  - id: end-of-file-fixer
         | 
| 12 | 
            +
                  - id: mixed-line-ending
         | 
| 13 | 
            +
                    args: ["--fix=lf"]
         | 
| 14 | 
            +
                  - id: requirements-txt-fixer
         | 
| 15 | 
            +
                  - id: trailing-whitespace
         | 
| 16 | 
            +
              - repo: https://github.com/astral-sh/ruff-pre-commit
         | 
| 17 | 
            +
                rev: v0.9.9
         | 
| 18 | 
            +
                hooks:
         | 
| 19 | 
            +
                  - id: ruff
         | 
| 20 | 
            +
                    args: ["--fix"]
         | 
| 21 | 
            +
                  - id: ruff-format
         | 
| 22 | 
            +
              - repo: https://github.com/pre-commit/mirrors-mypy
         | 
| 23 | 
            +
                rev: v1.15.0
         | 
| 24 | 
            +
                hooks:
         | 
| 25 | 
            +
                  - id: mypy
         | 
| 26 | 
            +
                    args: ["--ignore-missing-imports"]
         | 
| 27 | 
            +
                    additional_dependencies:
         | 
| 28 | 
            +
                      [
         | 
| 29 | 
            +
                        "types-python-slugify",
         | 
| 30 | 
            +
                        "types-pytz",
         | 
| 31 | 
            +
                        "types-PyYAML",
         | 
| 32 | 
            +
                        "types-requests",
         | 
| 33 | 
            +
                      ]
         | 
    	
        .python-version
    ADDED
    
    | @@ -0,0 +1 @@ | |
|  | 
|  | |
| 1 | 
            +
            3.10
         | 
    	
        .vscode/extensions.json
    ADDED
    
    | @@ -0,0 +1,8 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            {
         | 
| 2 | 
            +
                "recommendations": [
         | 
| 3 | 
            +
                    "ms-python.python",
         | 
| 4 | 
            +
                    "charliermarsh.ruff",
         | 
| 5 | 
            +
                    "streetsidesoftware.code-spell-checker",
         | 
| 6 | 
            +
                    "tamasfe.even-better-toml"
         | 
| 7 | 
            +
                ]
         | 
| 8 | 
            +
            }
         | 
    	
        .vscode/settings.json
    ADDED
    
    | @@ -0,0 +1,17 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            {
         | 
| 2 | 
            +
                "editor.formatOnSave": true,
         | 
| 3 | 
            +
                "files.insertFinalNewline": false,
         | 
| 4 | 
            +
                "[python]": {
         | 
| 5 | 
            +
                    "editor.defaultFormatter": "charliermarsh.ruff",
         | 
| 6 | 
            +
                    "editor.formatOnType": true,
         | 
| 7 | 
            +
                    "editor.codeActionsOnSave": {
         | 
| 8 | 
            +
                        "source.fixAll.ruff": "explicit",
         | 
| 9 | 
            +
                        "source.organizeImports": "explicit"
         | 
| 10 | 
            +
                    }
         | 
| 11 | 
            +
                },
         | 
| 12 | 
            +
                "[jupyter]": {
         | 
| 13 | 
            +
                    "files.insertFinalNewline": false
         | 
| 14 | 
            +
                },
         | 
| 15 | 
            +
                "notebook.output.scrolling": true,
         | 
| 16 | 
            +
                "notebook.formatOnSave.enabled": true
         | 
| 17 | 
            +
            }
         | 
    	
        app.py
    ADDED
    
    | @@ -0,0 +1,198 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            #!/usr/bin/env python
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            import os
         | 
| 4 | 
            +
            from collections.abc import Iterator
         | 
| 5 | 
            +
            from threading import Thread
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            # TODO: remove this once the code is released  # noqa: FIX002, TD002, TD003
         | 
| 8 | 
            +
            if os.getenv("SPACE_ID"):
         | 
| 9 | 
            +
                import shlex
         | 
| 10 | 
            +
                import subprocess
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                subprocess.run(shlex.split("pip install assets/transformers-4.50.0.dev0-py3-none-any.whl"), check=True)  # noqa: S603
         | 
| 13 | 
            +
             | 
| 14 | 
            +
             | 
| 15 | 
            +
            import gradio as gr
         | 
| 16 | 
            +
            import spaces
         | 
| 17 | 
            +
            import torch
         | 
| 18 | 
            +
            from transformers import AutoProcessor, Gemma3ForConditionalGeneration, TextIteratorStreamer
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            model_id = "gg-hf-g/gemma-3-12b-it"
         | 
| 21 | 
            +
            processor = AutoProcessor.from_pretrained(model_id)
         | 
| 22 | 
            +
            model = Gemma3ForConditionalGeneration.from_pretrained(
         | 
| 23 | 
            +
                model_id, device_map="auto", torch_dtype=torch.bfloat16, attn_implementation="eager"
         | 
| 24 | 
            +
            )
         | 
| 25 | 
            +
             | 
| 26 | 
            +
             | 
| 27 | 
            +
            def process_new_user_message(message: dict) -> list[dict]:
         | 
| 28 | 
            +
                return [{"type": "text", "text": message["text"]}, *[{"type": "image", "url": path} for path in message["files"]]]
         | 
| 29 | 
            +
             | 
| 30 | 
            +
             | 
| 31 | 
            +
            def process_history(history: list[dict]) -> list[dict]:
         | 
| 32 | 
            +
                messages = []
         | 
| 33 | 
            +
                current_user_content: list[dict] = []
         | 
| 34 | 
            +
                for item in history:
         | 
| 35 | 
            +
                    if item["role"] == "assistant":
         | 
| 36 | 
            +
                        if current_user_content:
         | 
| 37 | 
            +
                            messages.append({"role": "user", "content": current_user_content})
         | 
| 38 | 
            +
                            current_user_content = []
         | 
| 39 | 
            +
                        messages.append({"role": "assistant", "content": [{"type": "text", "text": item["content"]}]})
         | 
| 40 | 
            +
                    else:
         | 
| 41 | 
            +
                        content = item["content"]
         | 
| 42 | 
            +
                        if isinstance(content, str):
         | 
| 43 | 
            +
                            current_user_content.append({"type": "text", "text": content})
         | 
| 44 | 
            +
                        else:
         | 
| 45 | 
            +
                            current_user_content.append({"type": "image", "url": content[0]})
         | 
| 46 | 
            +
                return messages
         | 
| 47 | 
            +
             | 
| 48 | 
            +
             | 
| 49 | 
            +
            @spaces.GPU(duration=120)
         | 
| 50 | 
            +
            def run(message: dict, history: list[dict], system_prompt: str = "", max_new_tokens: int = 512) -> Iterator[str]:
         | 
| 51 | 
            +
                messages = []
         | 
| 52 | 
            +
                if system_prompt:
         | 
| 53 | 
            +
                    messages.append({"role": "system", "content": [{"type": "text", "text": system_prompt}]})
         | 
| 54 | 
            +
                messages.extend(process_history(history))
         | 
| 55 | 
            +
                messages.append({"role": "user", "content": process_new_user_message(message)})
         | 
| 56 | 
            +
             | 
| 57 | 
            +
                inputs = processor.apply_chat_template(
         | 
| 58 | 
            +
                    messages,
         | 
| 59 | 
            +
                    add_generation_prompt=True,
         | 
| 60 | 
            +
                    tokenize=True,
         | 
| 61 | 
            +
                    return_dict=True,
         | 
| 62 | 
            +
                    return_tensors="pt",
         | 
| 63 | 
            +
                ).to(device=model.device, dtype=torch.bfloat16)
         | 
| 64 | 
            +
             | 
| 65 | 
            +
                streamer = TextIteratorStreamer(processor, timeout=60.0, skip_prompt=True, skip_special_tokens=True)
         | 
| 66 | 
            +
                generate_kwargs = dict(
         | 
| 67 | 
            +
                    inputs,
         | 
| 68 | 
            +
                    streamer=streamer,
         | 
| 69 | 
            +
                    max_new_tokens=max_new_tokens,
         | 
| 70 | 
            +
                )
         | 
| 71 | 
            +
                t = Thread(target=model.generate, kwargs=generate_kwargs)
         | 
| 72 | 
            +
                t.start()
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                output = ""
         | 
| 75 | 
            +
                for delta in streamer:
         | 
| 76 | 
            +
                    output += delta
         | 
| 77 | 
            +
                    yield output
         | 
| 78 | 
            +
             | 
| 79 | 
            +
             | 
| 80 | 
            +
            examples = [
         | 
| 81 | 
            +
                [
         | 
| 82 | 
            +
                    {
         | 
| 83 | 
            +
                        "text": "caption this image",
         | 
| 84 | 
            +
                        "files": ["assets/sample-images/01.png"],
         | 
| 85 | 
            +
                    }
         | 
| 86 | 
            +
                ],
         | 
| 87 | 
            +
                [
         | 
| 88 | 
            +
                    {
         | 
| 89 | 
            +
                        "text": "What's the sign says?",
         | 
| 90 | 
            +
                        "files": ["assets/sample-images/02.png"],
         | 
| 91 | 
            +
                    }
         | 
| 92 | 
            +
                ],
         | 
| 93 | 
            +
                [
         | 
| 94 | 
            +
                    {
         | 
| 95 | 
            +
                        "text": "Compare and contrast the two images.",
         | 
| 96 | 
            +
                        "files": ["assets/sample-images/03.png"],
         | 
| 97 | 
            +
                    }
         | 
| 98 | 
            +
                ],
         | 
| 99 | 
            +
                [
         | 
| 100 | 
            +
                    {
         | 
| 101 | 
            +
                        "text": "List all the objects in the image and their colors.",
         | 
| 102 | 
            +
                        "files": ["assets/sample-images/04.png"],
         | 
| 103 | 
            +
                    }
         | 
| 104 | 
            +
                ],
         | 
| 105 | 
            +
                [
         | 
| 106 | 
            +
                    {
         | 
| 107 | 
            +
                        "text": "Describe the atmosphere of the scene.",
         | 
| 108 | 
            +
                        "files": ["assets/sample-images/05.png"],
         | 
| 109 | 
            +
                    }
         | 
| 110 | 
            +
                ],
         | 
| 111 | 
            +
                [
         | 
| 112 | 
            +
                    {
         | 
| 113 | 
            +
                        "text": "Write a poem inspired by the visual elements of the images.",
         | 
| 114 | 
            +
                        "files": ["assets/sample-images/06-1.png", "assets/sample-images/06-2.png"],
         | 
| 115 | 
            +
                    }
         | 
| 116 | 
            +
                ],
         | 
| 117 | 
            +
                [
         | 
| 118 | 
            +
                    {
         | 
| 119 | 
            +
                        "text": "Compose a short musical piece inspired by the visual elements of the images.",
         | 
| 120 | 
            +
                        "files": [
         | 
| 121 | 
            +
                            "assets/sample-images/07-1.png",
         | 
| 122 | 
            +
                            "assets/sample-images/07-2.png",
         | 
| 123 | 
            +
                            "assets/sample-images/07-3.png",
         | 
| 124 | 
            +
                            "assets/sample-images/07-4.png",
         | 
| 125 | 
            +
                        ],
         | 
| 126 | 
            +
                    }
         | 
| 127 | 
            +
                ],
         | 
| 128 | 
            +
                [
         | 
| 129 | 
            +
                    {
         | 
| 130 | 
            +
                        "text": "Write a short story about what might have happened in this house.",
         | 
| 131 | 
            +
                        "files": ["assets/sample-images/08.png"],
         | 
| 132 | 
            +
                    }
         | 
| 133 | 
            +
                ],
         | 
| 134 | 
            +
                [
         | 
| 135 | 
            +
                    {
         | 
| 136 | 
            +
                        "text": "Create a short story based on the sequence of images.",
         | 
| 137 | 
            +
                        "files": [
         | 
| 138 | 
            +
                            "assets/sample-images/09-1.png",
         | 
| 139 | 
            +
                            "assets/sample-images/09-2.png",
         | 
| 140 | 
            +
                            "assets/sample-images/09-3.png",
         | 
| 141 | 
            +
                            "assets/sample-images/09-4.png",
         | 
| 142 | 
            +
                            "assets/sample-images/09-5.png",
         | 
| 143 | 
            +
                        ],
         | 
| 144 | 
            +
                    }
         | 
| 145 | 
            +
                ],
         | 
| 146 | 
            +
                [
         | 
| 147 | 
            +
                    {
         | 
| 148 | 
            +
                        "text": "Describe the creatures that would live in this world.",
         | 
| 149 | 
            +
                        "files": ["assets/sample-images/10.png"],
         | 
| 150 | 
            +
                    }
         | 
| 151 | 
            +
                ],
         | 
| 152 | 
            +
                [
         | 
| 153 | 
            +
                    {
         | 
| 154 | 
            +
                        "text": "Read text in the image.",
         | 
| 155 | 
            +
                        "files": ["assets/additional-examples/1.png"],
         | 
| 156 | 
            +
                    }
         | 
| 157 | 
            +
                ],
         | 
| 158 | 
            +
                [
         | 
| 159 | 
            +
                    {
         | 
| 160 | 
            +
                        "text": "When is this ticket dated and how much did it cost?",
         | 
| 161 | 
            +
                        "files": ["assets/additional-examples/2.png"],
         | 
| 162 | 
            +
                    }
         | 
| 163 | 
            +
                ],
         | 
| 164 | 
            +
                [
         | 
| 165 | 
            +
                    {
         | 
| 166 | 
            +
                        "text": "Read the text in the image into markdown.",
         | 
| 167 | 
            +
                        "files": ["assets/additional-examples/3.png"],
         | 
| 168 | 
            +
                    }
         | 
| 169 | 
            +
                ],
         | 
| 170 | 
            +
                [
         | 
| 171 | 
            +
                    {
         | 
| 172 | 
            +
                        "text": "Evaluate this integral.",
         | 
| 173 | 
            +
                        "files": ["assets/additional-examples/4.png"],
         | 
| 174 | 
            +
                    }
         | 
| 175 | 
            +
                ],
         | 
| 176 | 
            +
            ]
         | 
| 177 | 
            +
             | 
| 178 | 
            +
            demo = gr.ChatInterface(
         | 
| 179 | 
            +
                fn=run,
         | 
| 180 | 
            +
                type="messages",
         | 
| 181 | 
            +
                textbox=gr.MultimodalTextbox(file_types=["image"], file_count="multiple"),
         | 
| 182 | 
            +
                multimodal=True,
         | 
| 183 | 
            +
                additional_inputs=[
         | 
| 184 | 
            +
                    gr.Textbox(label="System Prompt", value="You are a helpful assistant."),
         | 
| 185 | 
            +
                    gr.Slider(label="Max New Tokens", minimum=100, maximum=2000, step=10, value=500),
         | 
| 186 | 
            +
                ],
         | 
| 187 | 
            +
                stop_btn=False,
         | 
| 188 | 
            +
                title="Gemma 3 12B it",
         | 
| 189 | 
            +
                description="<img src='https://huggingface.co/spaces/huggingface-projects/gemma-3-12b-it/resolve/main/assets/logo.png' id='logo' />",
         | 
| 190 | 
            +
                examples=examples,
         | 
| 191 | 
            +
                run_examples_on_click=False,
         | 
| 192 | 
            +
                cache_examples=False,
         | 
| 193 | 
            +
                css_paths="style.css",
         | 
| 194 | 
            +
                delete_cache=(1800, 1800),
         | 
| 195 | 
            +
            )
         | 
| 196 | 
            +
             | 
| 197 | 
            +
            if __name__ == "__main__":
         | 
| 198 | 
            +
                demo.launch()
         | 
    	
        assets/additional-examples/1.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/additional-examples/2.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/additional-examples/3.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/additional-examples/4.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/logo.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/01.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/02.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/03.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/04.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/05.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/06-1.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/06-2.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/07-1.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/07-2.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/07-3.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/07-4.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/08.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/09-1.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/09-2.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/09-3.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/09-4.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/09-5.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/sample-images/10.png
    ADDED
    
    |   | 
| Git LFS Details
 | 
    	
        assets/transformers-4.50.0.dev0-py3-none-any.whl
    ADDED
    
    | @@ -0,0 +1,3 @@ | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            version https://git-lfs.github.com/spec/v1
         | 
| 2 | 
            +
            oid sha256:78972eef871bae197d8fd577623f017eb243f730ffecf02a3b70cacdc3d127fd
         | 
| 3 | 
            +
            size 10933656
         | 
    	
        pyproject.toml
    ADDED
    
    | @@ -0,0 +1,64 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            [project]
         | 
| 2 | 
            +
            name = "gemma-3-12b-it"
         | 
| 3 | 
            +
            version = "0.1.0"
         | 
| 4 | 
            +
            description = ""
         | 
| 5 | 
            +
            readme = "README.md"
         | 
| 6 | 
            +
            requires-python = ">=3.10"
         | 
| 7 | 
            +
            dependencies = [
         | 
| 8 | 
            +
                "accelerate>=1.4.0",
         | 
| 9 | 
            +
                "gradio>=5.20.1",
         | 
| 10 | 
            +
                "hf-transfer>=0.1.9",
         | 
| 11 | 
            +
                "protobuf>=6.30.0",
         | 
| 12 | 
            +
                "sentencepiece>=0.2.0",
         | 
| 13 | 
            +
                "spaces>=0.32.0",
         | 
| 14 | 
            +
                "torch==2.4.0",
         | 
| 15 | 
            +
            ]
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            [tool.ruff]
         | 
| 18 | 
            +
            line-length = 119
         | 
| 19 | 
            +
             | 
| 20 | 
            +
            [tool.ruff.lint]
         | 
| 21 | 
            +
            select = ["ALL"]
         | 
| 22 | 
            +
            ignore = [
         | 
| 23 | 
            +
                "COM812", # missing-trailing-comma
         | 
| 24 | 
            +
                "D203",   # one-blank-line-before-class
         | 
| 25 | 
            +
                "D213",   # multi-line-summary-second-line
         | 
| 26 | 
            +
                "E501",   # line-too-long
         | 
| 27 | 
            +
                "SIM117", # multiple-with-statements
         | 
| 28 | 
            +
                #
         | 
| 29 | 
            +
                "D100",    # undocumented-public-module
         | 
| 30 | 
            +
                "D101",    # undocumented-public-class
         | 
| 31 | 
            +
                "D102",    # undocumented-public-method
         | 
| 32 | 
            +
                "D103",    # undocumented-public-function
         | 
| 33 | 
            +
                "D104",    # undocumented-public-package
         | 
| 34 | 
            +
                "D105",    # undocumented-magic-method
         | 
| 35 | 
            +
                "D107",    # undocumented-public-init
         | 
| 36 | 
            +
                "EM101",   # raw-string-in-exception
         | 
| 37 | 
            +
                "FBT001",  # boolean-type-hint-positional-argument
         | 
| 38 | 
            +
                "FBT002",  # boolean-default-value-positional-argument
         | 
| 39 | 
            +
                "PD901",   # pandas-df-variable-name
         | 
| 40 | 
            +
                "PGH003",  # blanket-type-ignore
         | 
| 41 | 
            +
                "PLR0913", # too-many-arguments
         | 
| 42 | 
            +
                "PLR0915", # too-many-statements
         | 
| 43 | 
            +
                "TRY003",  # raise-vanilla-args
         | 
| 44 | 
            +
            ]
         | 
| 45 | 
            +
            unfixable = [
         | 
| 46 | 
            +
                "F401", # unused-import
         | 
| 47 | 
            +
            ]
         | 
| 48 | 
            +
             | 
| 49 | 
            +
            [tool.ruff.lint.pydocstyle]
         | 
| 50 | 
            +
            convention = "google"
         | 
| 51 | 
            +
             | 
| 52 | 
            +
            [tool.ruff.lint.per-file-ignores]
         | 
| 53 | 
            +
            "*.ipynb" = ["T201", "T203"]
         | 
| 54 | 
            +
             | 
| 55 | 
            +
            [tool.ruff.format]
         | 
| 56 | 
            +
            docstring-code-format = true
         | 
| 57 | 
            +
             | 
| 58 | 
            +
            [tool.uv.sources]
         | 
| 59 | 
            +
            transformers = { path = "assets/transformers-4.50.0.dev0-py3-none-any.whl" }
         | 
| 60 | 
            +
             | 
| 61 | 
            +
            [dependency-groups]
         | 
| 62 | 
            +
            dev = [
         | 
| 63 | 
            +
                "transformers",
         | 
| 64 | 
            +
            ]
         | 
    	
        requirements.txt
    ADDED
    
    | @@ -0,0 +1,229 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            # This file was autogenerated by uv via the following command:
         | 
| 2 | 
            +
            #    uv pip compile pyproject.toml -o requirements.txt
         | 
| 3 | 
            +
            accelerate==1.4.0
         | 
| 4 | 
            +
                # via gemma-3-12b-it (pyproject.toml)
         | 
| 5 | 
            +
            aiofiles==23.2.1
         | 
| 6 | 
            +
                # via gradio
         | 
| 7 | 
            +
            annotated-types==0.7.0
         | 
| 8 | 
            +
                # via pydantic
         | 
| 9 | 
            +
            anyio==4.8.0
         | 
| 10 | 
            +
                # via
         | 
| 11 | 
            +
                #   gradio
         | 
| 12 | 
            +
                #   httpx
         | 
| 13 | 
            +
                #   starlette
         | 
| 14 | 
            +
            certifi==2025.1.31
         | 
| 15 | 
            +
                # via
         | 
| 16 | 
            +
                #   httpcore
         | 
| 17 | 
            +
                #   httpx
         | 
| 18 | 
            +
                #   requests
         | 
| 19 | 
            +
            charset-normalizer==3.4.1
         | 
| 20 | 
            +
                # via requests
         | 
| 21 | 
            +
            click==8.1.8
         | 
| 22 | 
            +
                # via
         | 
| 23 | 
            +
                #   typer
         | 
| 24 | 
            +
                #   uvicorn
         | 
| 25 | 
            +
            exceptiongroup==1.2.2
         | 
| 26 | 
            +
                # via anyio
         | 
| 27 | 
            +
            fastapi==0.115.11
         | 
| 28 | 
            +
                # via gradio
         | 
| 29 | 
            +
            ffmpy==0.5.0
         | 
| 30 | 
            +
                # via gradio
         | 
| 31 | 
            +
            filelock==3.17.0
         | 
| 32 | 
            +
                # via
         | 
| 33 | 
            +
                #   huggingface-hub
         | 
| 34 | 
            +
                #   torch
         | 
| 35 | 
            +
                #   triton
         | 
| 36 | 
            +
            fsspec==2025.3.0
         | 
| 37 | 
            +
                # via
         | 
| 38 | 
            +
                #   gradio-client
         | 
| 39 | 
            +
                #   huggingface-hub
         | 
| 40 | 
            +
                #   torch
         | 
| 41 | 
            +
            gradio==5.20.1
         | 
| 42 | 
            +
                # via
         | 
| 43 | 
            +
                #   gemma-3-12b-it (pyproject.toml)
         | 
| 44 | 
            +
                #   spaces
         | 
| 45 | 
            +
            gradio-client==1.7.2
         | 
| 46 | 
            +
                # via gradio
         | 
| 47 | 
            +
            groovy==0.1.2
         | 
| 48 | 
            +
                # via gradio
         | 
| 49 | 
            +
            h11==0.14.0
         | 
| 50 | 
            +
                # via
         | 
| 51 | 
            +
                #   httpcore
         | 
| 52 | 
            +
                #   uvicorn
         | 
| 53 | 
            +
            hf-transfer==0.1.9
         | 
| 54 | 
            +
                # via gemma-3-12b-it (pyproject.toml)
         | 
| 55 | 
            +
            httpcore==1.0.7
         | 
| 56 | 
            +
                # via httpx
         | 
| 57 | 
            +
            httpx==0.28.1
         | 
| 58 | 
            +
                # via
         | 
| 59 | 
            +
                #   gradio
         | 
| 60 | 
            +
                #   gradio-client
         | 
| 61 | 
            +
                #   safehttpx
         | 
| 62 | 
            +
                #   spaces
         | 
| 63 | 
            +
            huggingface-hub==0.29.2
         | 
| 64 | 
            +
                # via
         | 
| 65 | 
            +
                #   accelerate
         | 
| 66 | 
            +
                #   gradio
         | 
| 67 | 
            +
                #   gradio-client
         | 
| 68 | 
            +
            idna==3.10
         | 
| 69 | 
            +
                # via
         | 
| 70 | 
            +
                #   anyio
         | 
| 71 | 
            +
                #   httpx
         | 
| 72 | 
            +
                #   requests
         | 
| 73 | 
            +
            jinja2==3.1.6
         | 
| 74 | 
            +
                # via
         | 
| 75 | 
            +
                #   gradio
         | 
| 76 | 
            +
                #   torch
         | 
| 77 | 
            +
            markdown-it-py==3.0.0
         | 
| 78 | 
            +
                # via rich
         | 
| 79 | 
            +
            markupsafe==2.1.5
         | 
| 80 | 
            +
                # via
         | 
| 81 | 
            +
                #   gradio
         | 
| 82 | 
            +
                #   jinja2
         | 
| 83 | 
            +
            mdurl==0.1.2
         | 
| 84 | 
            +
                # via markdown-it-py
         | 
| 85 | 
            +
            mpmath==1.3.0
         | 
| 86 | 
            +
                # via sympy
         | 
| 87 | 
            +
            networkx==3.4.2
         | 
| 88 | 
            +
                # via torch
         | 
| 89 | 
            +
            numpy==2.2.3
         | 
| 90 | 
            +
                # via
         | 
| 91 | 
            +
                #   accelerate
         | 
| 92 | 
            +
                #   gradio
         | 
| 93 | 
            +
                #   pandas
         | 
| 94 | 
            +
            nvidia-cublas-cu12==12.1.3.1
         | 
| 95 | 
            +
                # via
         | 
| 96 | 
            +
                #   nvidia-cudnn-cu12
         | 
| 97 | 
            +
                #   nvidia-cusolver-cu12
         | 
| 98 | 
            +
                #   torch
         | 
| 99 | 
            +
            nvidia-cuda-cupti-cu12==12.1.105
         | 
| 100 | 
            +
                # via torch
         | 
| 101 | 
            +
            nvidia-cuda-nvrtc-cu12==12.1.105
         | 
| 102 | 
            +
                # via torch
         | 
| 103 | 
            +
            nvidia-cuda-runtime-cu12==12.1.105
         | 
| 104 | 
            +
                # via torch
         | 
| 105 | 
            +
            nvidia-cudnn-cu12==9.1.0.70
         | 
| 106 | 
            +
                # via torch
         | 
| 107 | 
            +
            nvidia-cufft-cu12==11.0.2.54
         | 
| 108 | 
            +
                # via torch
         | 
| 109 | 
            +
            nvidia-curand-cu12==10.3.2.106
         | 
| 110 | 
            +
                # via torch
         | 
| 111 | 
            +
            nvidia-cusolver-cu12==11.4.5.107
         | 
| 112 | 
            +
                # via torch
         | 
| 113 | 
            +
            nvidia-cusparse-cu12==12.1.0.106
         | 
| 114 | 
            +
                # via
         | 
| 115 | 
            +
                #   nvidia-cusolver-cu12
         | 
| 116 | 
            +
                #   torch
         | 
| 117 | 
            +
            nvidia-nccl-cu12==2.20.5
         | 
| 118 | 
            +
                # via torch
         | 
| 119 | 
            +
            nvidia-nvjitlink-cu12==12.8.93
         | 
| 120 | 
            +
                # via
         | 
| 121 | 
            +
                #   nvidia-cusolver-cu12
         | 
| 122 | 
            +
                #   nvidia-cusparse-cu12
         | 
| 123 | 
            +
            nvidia-nvtx-cu12==12.1.105
         | 
| 124 | 
            +
                # via torch
         | 
| 125 | 
            +
            orjson==3.10.15
         | 
| 126 | 
            +
                # via gradio
         | 
| 127 | 
            +
            packaging==24.2
         | 
| 128 | 
            +
                # via
         | 
| 129 | 
            +
                #   accelerate
         | 
| 130 | 
            +
                #   gradio
         | 
| 131 | 
            +
                #   gradio-client
         | 
| 132 | 
            +
                #   huggingface-hub
         | 
| 133 | 
            +
                #   spaces
         | 
| 134 | 
            +
            pandas==2.2.3
         | 
| 135 | 
            +
                # via gradio
         | 
| 136 | 
            +
            pillow==11.1.0
         | 
| 137 | 
            +
                # via gradio
         | 
| 138 | 
            +
            protobuf==6.30.0
         | 
| 139 | 
            +
                # via gemma-3-12b-it (pyproject.toml)
         | 
| 140 | 
            +
            psutil==5.9.8
         | 
| 141 | 
            +
                # via
         | 
| 142 | 
            +
                #   accelerate
         | 
| 143 | 
            +
                #   spaces
         | 
| 144 | 
            +
            pydantic==2.10.6
         | 
| 145 | 
            +
                # via
         | 
| 146 | 
            +
                #   fastapi
         | 
| 147 | 
            +
                #   gradio
         | 
| 148 | 
            +
                #   spaces
         | 
| 149 | 
            +
            pydantic-core==2.27.2
         | 
| 150 | 
            +
                # via pydantic
         | 
| 151 | 
            +
            pydub==0.25.1
         | 
| 152 | 
            +
                # via gradio
         | 
| 153 | 
            +
            pygments==2.19.1
         | 
| 154 | 
            +
                # via rich
         | 
| 155 | 
            +
            python-dateutil==2.9.0.post0
         | 
| 156 | 
            +
                # via pandas
         | 
| 157 | 
            +
            python-multipart==0.0.20
         | 
| 158 | 
            +
                # via gradio
         | 
| 159 | 
            +
            pytz==2025.1
         | 
| 160 | 
            +
                # via pandas
         | 
| 161 | 
            +
            pyyaml==6.0.2
         | 
| 162 | 
            +
                # via
         | 
| 163 | 
            +
                #   accelerate
         | 
| 164 | 
            +
                #   gradio
         | 
| 165 | 
            +
                #   huggingface-hub
         | 
| 166 | 
            +
            requests==2.32.3
         | 
| 167 | 
            +
                # via
         | 
| 168 | 
            +
                #   huggingface-hub
         | 
| 169 | 
            +
                #   spaces
         | 
| 170 | 
            +
            rich==13.9.4
         | 
| 171 | 
            +
                # via typer
         | 
| 172 | 
            +
            ruff==0.9.10
         | 
| 173 | 
            +
                # via gradio
         | 
| 174 | 
            +
            safehttpx==0.1.6
         | 
| 175 | 
            +
                # via gradio
         | 
| 176 | 
            +
            safetensors==0.5.3
         | 
| 177 | 
            +
                # via accelerate
         | 
| 178 | 
            +
            semantic-version==2.10.0
         | 
| 179 | 
            +
                # via gradio
         | 
| 180 | 
            +
            sentencepiece==0.2.0
         | 
| 181 | 
            +
                # via gemma-3-12b-it (pyproject.toml)
         | 
| 182 | 
            +
            shellingham==1.5.4
         | 
| 183 | 
            +
                # via typer
         | 
| 184 | 
            +
            six==1.17.0
         | 
| 185 | 
            +
                # via python-dateutil
         | 
| 186 | 
            +
            sniffio==1.3.1
         | 
| 187 | 
            +
                # via anyio
         | 
| 188 | 
            +
            spaces==0.32.0
         | 
| 189 | 
            +
                # via gemma-3-12b-it (pyproject.toml)
         | 
| 190 | 
            +
            starlette==0.46.1
         | 
| 191 | 
            +
                # via
         | 
| 192 | 
            +
                #   fastapi
         | 
| 193 | 
            +
                #   gradio
         | 
| 194 | 
            +
            sympy==1.13.3
         | 
| 195 | 
            +
                # via torch
         | 
| 196 | 
            +
            tomlkit==0.13.2
         | 
| 197 | 
            +
                # via gradio
         | 
| 198 | 
            +
            torch==2.4.0
         | 
| 199 | 
            +
                # via
         | 
| 200 | 
            +
                #   gemma-3-12b-it (pyproject.toml)
         | 
| 201 | 
            +
                #   accelerate
         | 
| 202 | 
            +
            tqdm==4.67.1
         | 
| 203 | 
            +
                # via huggingface-hub
         | 
| 204 | 
            +
            triton==3.0.0
         | 
| 205 | 
            +
                # via torch
         | 
| 206 | 
            +
            typer==0.15.2
         | 
| 207 | 
            +
                # via gradio
         | 
| 208 | 
            +
            typing-extensions==4.12.2
         | 
| 209 | 
            +
                # via
         | 
| 210 | 
            +
                #   anyio
         | 
| 211 | 
            +
                #   fastapi
         | 
| 212 | 
            +
                #   gradio
         | 
| 213 | 
            +
                #   gradio-client
         | 
| 214 | 
            +
                #   huggingface-hub
         | 
| 215 | 
            +
                #   pydantic
         | 
| 216 | 
            +
                #   pydantic-core
         | 
| 217 | 
            +
                #   rich
         | 
| 218 | 
            +
                #   spaces
         | 
| 219 | 
            +
                #   torch
         | 
| 220 | 
            +
                #   typer
         | 
| 221 | 
            +
                #   uvicorn
         | 
| 222 | 
            +
            tzdata==2025.1
         | 
| 223 | 
            +
                # via pandas
         | 
| 224 | 
            +
            urllib3==2.3.0
         | 
| 225 | 
            +
                # via requests
         | 
| 226 | 
            +
            uvicorn==0.34.0
         | 
| 227 | 
            +
                # via gradio
         | 
| 228 | 
            +
            websockets==15.0.1
         | 
| 229 | 
            +
                # via gradio-client
         | 
    	
        style.css
    ADDED
    
    | @@ -0,0 +1,11 @@ | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
|  | |
| 1 | 
            +
            h1 {
         | 
| 2 | 
            +
              text-align: center;
         | 
| 3 | 
            +
              display: block;
         | 
| 4 | 
            +
            }
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            #logo {
         | 
| 7 | 
            +
              display: block;
         | 
| 8 | 
            +
              margin: 0 auto;
         | 
| 9 | 
            +
              width: 40%;
         | 
| 10 | 
            +
              object-fit: contain;
         | 
| 11 | 
            +
            }
         | 
    	
        uv.lock
    ADDED
    
    | The diff for this file is too large to render. 
		See raw diff | 
|  | 
 
			
