File size: 2,440 Bytes
47c6969
 
2ec5d53
 
 
47c6969
 
 
2ec5d53
47c6969
2ec5d53
47c6969
2ec5d53
4e2fb1c
2ec5d53
47c6969
2ec5d53
47c6969
2ec5d53
47c6969
4e2fb1c
47c6969
2ec5d53
47c6969
2ec5d53
 
 
 
 
 
 
47c6969
2ec5d53
47c6969
2ec5d53
 
 
 
 
47c6969
2ec5d53
47c6969
2ec5d53
 
47c6969
2ec5d53
 
 
47c6969
2ec5d53
 
 
 
47c6969
2ec5d53
 
 
 
 
47c6969
2ec5d53
 
 
 
 
 
47c6969
2ec5d53
 
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
library_name: transformers
license: gemma
base_model:
- google/gemma-3-27b-it
---


# Gemma 3 Text-Only Model Card

## Model Information

**Original Model**: [Gemma 3](https://huggingface.co/google/gemma-3) by Google DeepMind

**Adaptation**: Text-only version (Image processing capabilities removed)

## Description

This is a text-only version of the Gemma 3 model, adapted from Google's original multimodal Gemma 3. The image processing capabilities have been removed while preserving the text generation capabilities.

This text-only adaptation maintains the core language capabilities with a 128K context window and multilingual support in over 140 languages. The model is well-suited for a variety of text generation tasks, including question answering, summarization, and reasoning.

The adaptation makes the model more lightweight and suitable for environments where only text processing is needed, or where resource constraints make the full multimodal model impractical.

## Inputs and outputs
* **Input:**
   * Text string, such as a question, a prompt, or a document to be summarized
   * Total input context of 128K tokens for the 27B size
* **Output:**
   * Generated text in response to the input, such as an answer to a question or a summary of a document
   * Total output context of 8192 tokens

## Adaptation Details

This adaptation:
1. Removes the image processing components from the model
2. Maintains the same text tokenization and generation capabilities
3. Is compatible with standard text-only inference pipelines
4. Can be used with regular `AutoModelForCausalLM` instead of requiring specialized multimodal classes

## Usage

```python
from transformers import AutoTokenizer, AutoModelForCausalLM

model_id = "your-username/gemma-3-27b-text" # Replace with your model path after uploading
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)

messages = [
    {"role": "system", "content": "You are an AI assistant that provides helpful and accurate information."},
    {"role": "user", "content": "Hello. How's the weather today?"}
]

inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt"
)

outputs = model.generate(
    inputs,
    max_new_tokens=512,
    temperature=0.2,
    do_sample=True
)

response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
print(response)