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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -16
app.py CHANGED
@@ -49,7 +49,6 @@ def predict(system_msg, inputs, top_p, temperature, chat_counter, chatbot=[], hi
49
 
50
  # Kullanıcı girişindeki kelimeleri küçük harfe çevirip listeye alıyoruz.
51
  input_words = [str(word).lower() for word in inputs.split()]
52
-
53
  for product_info in products:
54
  if product_info[0] in input_words:
55
  new_msg = f"{product_info[2]} {product_info[1][0]} ve fiyatı EURO {product_info[1][1]}"
@@ -106,23 +105,29 @@ def reset_textbox():
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 */
126
  #send_button {
127
  background-color: #0b93f6;
128
  border: none;
@@ -133,8 +138,6 @@ demo_css = """
133
  height: 35px !important;
134
  min-width: 35px !important;
135
  min-height: 35px !important;
136
- max-width: 35px !important;
137
- max-height: 35px !important;
138
  display: inline-flex;
139
  align-items: center;
140
  justify-content: center;
@@ -144,13 +147,6 @@ demo_css = """
144
  #send_button:hover {
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ı:
@@ -169,7 +165,7 @@ with gr.Blocks(css=demo_css, theme=theme) as demo:
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.",
@@ -177,8 +173,7 @@ with gr.Blocks(css=demo_css, theme=theme) as demo:
177
  container=True,
178
  elem_classes="mobile_input"
179
  )
180
- with gr.Column(elem_classes="fixed_button_container"):
181
- send_button = gr.Button(value="✈", elem_id="send_button")
182
 
183
  state = gr.State([])
184
  with gr.Accordion("", open=False, visible=False):
 
49
 
50
  # Kullanıcı girişindeki kelimeleri küçük harfe çevirip listeye alıyoruz.
51
  input_words = [str(word).lower() for word in inputs.split()]
 
52
  for product_info in products:
53
  if product_info[0] in input_words:
54
  new_msg = f"{product_info[2]} {product_info[1][0]} ve fiyatı EURO {product_info[1][1]}"
 
105
 
106
  # CSS ayarları:
107
  demo_css = """
108
+ /* Ana sütunun (column) tam genişlikte olmasını sağlıyoruz */
109
+ #col_container {
110
+ width: 100% !important;
111
+ }
112
+
113
+ /* Satır container'ı: tam genişlik, öğeler aynı satırda, arada boşluk yok */
114
  .compact_row {
115
  display: flex !important;
116
  flex-wrap: nowrap !important;
117
  align-items: center !important;
118
+ justify-content: space-between; /* öğeler satır boyunca yayılır */
119
  width: 100% !important;
120
  gap: 0 !important;
121
  margin: 0;
122
  }
123
 
124
+ /* Giriş kutusuna, gönder butonunun alanını çıkararak tam genişlik kullanması için */
125
  .mobile_input {
126
  width: calc(100% - 45px) !important;
127
  min-width: 0;
128
  }
129
 
130
+ /* Gönder butonu: sabit boyut, yuvarlak */
131
  #send_button {
132
  background-color: #0b93f6;
133
  border: none;
 
138
  height: 35px !important;
139
  min-width: 35px !important;
140
  min-height: 35px !important;
 
 
141
  display: inline-flex;
142
  align-items: center;
143
  justify-content: center;
 
147
  #send_button:hover {
148
  background-color: #0077c0;
149
  }
 
 
 
 
 
 
 
150
  """
151
 
152
  # Tema ayarları:
 
165
 
166
  chatbot = gr.Chatbot(label='Trek Asistanı', elem_id="chatbot")
167
 
168
+ # Giriş kutusu ve gönder butonunun aynı satırda, tam genişlik kullanması için
169
  with gr.Row(elem_classes="compact_row"):
170
  inputs = gr.Textbox(
171
  placeholder="Buraya yazın, yanıtlayalım.",
 
173
  container=True,
174
  elem_classes="mobile_input"
175
  )
176
+ send_button = gr.Button(value="", elem_id="send_button")
 
177
 
178
  state = gr.State([])
179
  with gr.Accordion("", open=False, visible=False):