SamiKoen commited on
Commit
b5bff46
·
verified ·
1 Parent(s): dbceb97

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -13
app.py CHANGED
@@ -104,22 +104,22 @@ def predict(system_msg, inputs, top_p, temperature, chat_counter, chatbot=[], hi
104
  def reset_textbox():
105
  return gr.update(value='')
106
 
107
- # CSS
108
  demo_css = """
109
- /* Row'u esnek yapıp, satır kaymasını önlemek için */
110
  .compact_row {
111
  display: flex !important;
112
  flex-wrap: nowrap !important;
113
  align-items: center !important;
114
- gap: 0px !important;
115
- margin: 0px;
 
116
  }
117
 
118
- /* Giriş kutusuna mobilde genişlik sınırlaması */
119
  .mobile_input {
120
- /* Buton alanı sabit 45px olacak şekilde, kalan alanı kullan */
121
  width: calc(100% - 45px) !important;
122
- min-width: 0;
123
  }
124
 
125
  /* Gönder butonu */
@@ -145,15 +145,15 @@ demo_css = """
145
  background-color: #0077c0;
146
  }
147
 
148
- /* Buton kapsayıcısı: konumlandırma için */
149
  .fixed_button_container {
150
  width: 35px !important;
151
- padding: 0px;
152
  margin: 5px 0 0 2px; /* Üstte 5px, solda 2px boşluk */
153
  }
154
  """
155
 
156
- # Tema ayarları
157
  theme = gr.themes.Base(
158
  neutral_hue="blue",
159
  text_size="sm",
@@ -169,7 +169,7 @@ with gr.Blocks(css=demo_css, theme=theme) as demo:
169
 
170
  chatbot = gr.Chatbot(label='Trek Asistanı', elem_id="chatbot")
171
 
172
- # compact_row sınıfı sayesinde aynı satırda kalmalarını sağlıyoruz.
173
  with gr.Row(elem_classes="compact_row"):
174
  inputs = gr.Textbox(
175
  placeholder="Buraya yazın, yanıtlayalım.",
@@ -188,7 +188,7 @@ with gr.Blocks(css=demo_css, theme=theme) as demo:
188
  step=0.1, interactive=False, visible=False)
189
  chat_counter = gr.Number(value=0, visible=False, precision=0)
190
 
191
- # ENTER tuşuyla gönderme işlemi
192
  inputs.submit(
193
  predict,
194
  [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state],
@@ -196,7 +196,6 @@ with gr.Blocks(css=demo_css, theme=theme) as demo:
196
  )
197
  inputs.submit(reset_textbox, [], [inputs])
198
 
199
- # Gönder butonuna tıklanıldığında
200
  send_button.click(
201
  predict,
202
  [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state],
 
104
  def reset_textbox():
105
  return gr.update(value='')
106
 
107
+ # CSS ayarları:
108
  demo_css = """
109
+ /* Satırın tamamını kaplayan flex container */
110
  .compact_row {
111
  display: flex !important;
112
  flex-wrap: nowrap !important;
113
  align-items: center !important;
114
+ width: 100% !important;
115
+ gap: 0 !important;
116
+ margin: 0;
117
  }
118
 
119
+ /* Giriş kutusu: buton alanı kadar çıkarmak için */
120
  .mobile_input {
 
121
  width: calc(100% - 45px) !important;
122
+ min-width: 0;
123
  }
124
 
125
  /* Gönder butonu */
 
145
  background-color: #0077c0;
146
  }
147
 
148
+ /* Buton kapsayıcısı: kenar boşluklarını ayarla */
149
  .fixed_button_container {
150
  width: 35px !important;
151
+ padding: 0;
152
  margin: 5px 0 0 2px; /* Üstte 5px, solda 2px boşluk */
153
  }
154
  """
155
 
156
+ # Tema ayarları:
157
  theme = gr.themes.Base(
158
  neutral_hue="blue",
159
  text_size="sm",
 
169
 
170
  chatbot = gr.Chatbot(label='Trek Asistanı', elem_id="chatbot")
171
 
172
+ # Giriş kutusu ve buton aynı satırda, satır tüm genişliği kaplasın.
173
  with gr.Row(elem_classes="compact_row"):
174
  inputs = gr.Textbox(
175
  placeholder="Buraya yazın, yanıtlayalım.",
 
188
  step=0.1, interactive=False, visible=False)
189
  chat_counter = gr.Number(value=0, visible=False, precision=0)
190
 
191
+ # ENTER tuşuyla gönderme işlemleri:
192
  inputs.submit(
193
  predict,
194
  [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state],
 
196
  )
197
  inputs.submit(reset_textbox, [], [inputs])
198
 
 
199
  send_button.click(
200
  predict,
201
  [system_msg, inputs, top_p, temperature, chat_counter, chatbot, state],