File size: 767 Bytes
abe7a5d
 
 
 
 
 
 
04a03fc
 
a5dc4f3
04a03fc
 
abe7a5d
 
 
 
 
 
37f622b
 
b463dbd
de49e6a
37f622b
b463dbd
 
37f622b
 
abe7a5d
37f622b
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
"""
File: app.py
Description: Chat with the vision language model Gemma3.
Author: Didier Guillevic
Date: 2025-03-16
"""

from huggingface_hub import login, whoami
import os
token = os.getenv('HF_TOKEN')
login(token=token)

import gradio as gr
from transformers import AutoProcessor, Gemma3ForConditionalGeneration
from transformers import TextIteratorStreamer
from threading import Thread
import torch

from module_chat import demo as chat_block
from module_translation import demo as translation_block
from module_rewriting import demo as rewriting_block

demo = gr.TabbedInterface(
    interface_list=[chat_block, translation_block, rewriting_block],
    tab_names=["Chat", "Translation", "Rewriting"],
    title="Chat with a vision language model"
)

demo.launch()