File size: 1,621 Bytes
3511864
 
d5ee2a4
3511864
 
 
 
 
 
 
 
 
 
d5ee2a4
133562c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
title: Refsheet Chat
emoji: 💬
colorFrom: gray
colorTo: green
sdk: gradio
sdk_version: 5.21.0
app_file: app.py
pinned: false
license: mit
short_description: Chat with a character via reference sheet!
---

# Chat via Reference Sheet

A demo of [Gemma 3](https://blog.google/technology/developers/gemma-3/), demonstrating its excellent vision and multilingual capability.

## Environment Configuration

Register an account on [HuggingFace](https://huggingface.co)

Submit a Gemma Access Request from <https://huggingface.co/google/gemma-3-4b-it>. The access should be granted immediately with an email notification. After that, the model page will show 

> Gated model: You have been granted access to this model

Create conda environment with pip and Python 3.12
```bash
conda create -n transformers_gemma pip python=3.12
conda activate transformers_gemma
```

Install [HuggingFace Transformers for Gemma 3](https://github.com/huggingface/transformers/releases/tag/v4.49.0-Gemma-3):
```bash
pip install git+https://github.com/huggingface/[email protected]
```

Install [PyTorch](https://pytorch.org/get-started/locally/)

On Nvidia GPU (with CUDA 12.6):
```bash
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu126
```

On CPU:
```bash
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
```

Create an User Access Token from <https://huggingface.co/docs/hub/security-tokens>, then log in to your HuggingFace account with `huggingface-cli`:

```bash
huggingface-cli login
```

Copy-paste your access token and press enter.