Norod78 commited on
Commit
7bf2a69
·
verified ·
1 Parent(s): 5b3c141

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -12,6 +12,8 @@ TITLE = " google/gemma-3-270m-it "
12
  DESCRIPTION= """
13
  It's so small
14
  """
 
 
15
 
16
  # model config
17
  model_name = "google/gemma-3-270m-it"
@@ -132,7 +134,7 @@ def generate_response(input_data, chat_history, max_new_tokens, system_prompt, t
132
 
133
  chat_interface = gr.ChatInterface(
134
  fn=generate_response,
135
- chatbot=gr.Chatbot(rtl=True, show_copy_button=True,type="messages"),
136
  additional_inputs=[
137
  gr.Slider(label="Max new tokens", minimum=100, maximum=2000, step=1, value=512),
138
  gr.Textbox(
@@ -140,7 +142,7 @@ chat_interface = gr.ChatInterface(
140
  value="You are a very helpful multimodal assistant",
141
  lines=4,
142
  placeholder="Change the settings",
143
- text_align = 'left', rtl = False
144
  ),
145
  gr.Slider(label="Temperature", minimum=0.1, maximum=2.0, step=0.1, value=0.2),
146
  gr.Slider(label="Top-p", minimum=0.05, maximum=1.0, step=0.05, value=0.4),
@@ -151,7 +153,7 @@ chat_interface = gr.ChatInterface(
151
  [{"text": "Write a poem which describes potatoes"}],
152
  ],
153
  textbox=gr.MultimodalTextbox(
154
- rtl=False,
155
  label="input",
156
  file_types=["image", "video"],
157
  file_count="multiple",
 
12
  DESCRIPTION= """
13
  It's so small
14
  """
15
+ IS_RTL = False
16
+ TEXT_ALIGN = "left"
17
 
18
  # model config
19
  model_name = "google/gemma-3-270m-it"
 
134
 
135
  chat_interface = gr.ChatInterface(
136
  fn=generate_response,
137
+ chatbot=gr.Chatbot(rtl=IS_RTL, show_copy_button=True,type="messages"),
138
  additional_inputs=[
139
  gr.Slider(label="Max new tokens", minimum=100, maximum=2000, step=1, value=512),
140
  gr.Textbox(
 
142
  value="You are a very helpful multimodal assistant",
143
  lines=4,
144
  placeholder="Change the settings",
145
+ text_align = TEXT_ALIGN, rtl = IS_RTL
146
  ),
147
  gr.Slider(label="Temperature", minimum=0.1, maximum=2.0, step=0.1, value=0.2),
148
  gr.Slider(label="Top-p", minimum=0.05, maximum=1.0, step=0.05, value=0.4),
 
153
  [{"text": "Write a poem which describes potatoes"}],
154
  ],
155
  textbox=gr.MultimodalTextbox(
156
+ rtl=IS_RTL,
157
  label="input",
158
  file_types=["image", "video"],
159
  file_count="multiple",