suayptalha commited on
Commit
8784854
·
verified ·
1 Parent(s): 5c2139d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -12
app.py CHANGED
@@ -57,7 +57,6 @@ def process_turn(user_answer, history):
57
  end_idx = assistant_message.index("</answer>")
58
  final_answer = assistant_message[start_idx:end_idx].strip()
59
  if final_answer:
60
- # Assistant kendini tahmin ettiyse, asistan metnini sakla, final cevabı göster
61
  assistant_update = gr.update(visible=False)
62
  final_text = f"**My guess:** **{final_answer}**"
63
  answer_update = gr.update(visible=False)
@@ -65,7 +64,6 @@ def process_turn(user_answer, history):
65
  restart_update = gr.update(visible=False)
66
  continue_update = gr.update(visible=False)
67
  else:
68
- # Tahmin yoksa, asistan metnini göster, final cevabı temizle
69
  assistant_update = gr.update(visible=True, value=assistant_message)
70
  final_text = ""
71
  answer_update = gr.update(visible=True)
@@ -152,7 +150,7 @@ body, .gradio-container {
152
  background-position: center !important;
153
  background-repeat: no-repeat !important;
154
  background-attachment: fixed !important;
155
- color: #000 !important; /* Genel metin rengi siyah */
156
  }
157
 
158
  /* Üstteki başlık için stil */
@@ -160,13 +158,13 @@ body, .gradio-container {
160
  text-align: center;
161
  margin-top: 20px;
162
  font-size: 2em;
163
- color: #000 !important; /* Siyah */
164
  }
165
 
166
  /* Özel buton sınıfımız: my-button */
167
  .my-button {
168
- background-color: #4261a8 !important; /* Buton arka plan rengi */
169
- color: #fff !important; /* Buton içerisindeki yazılar beyaz kalır */
170
  border: none !important;
171
  transition: transform 0.3s, background-color 0.3s !important;
172
  }
@@ -183,8 +181,7 @@ body, .gradio-container {
183
  margin: 10px auto;
184
  width: 80%;
185
  text-align: center;
186
- background-color: rgba(173, 216, 230, 0); /* Yarı saydam soluk cyan */
187
- color: #000 !important; /* Siyah */
188
  }
189
 
190
  /* Gradio Markdown’un varsayılan arka planını şeffaf yapmak */
@@ -192,7 +189,6 @@ body, .gradio-container {
192
  background-color: transparent !important;
193
  box-shadow: none !important;
194
  border: none !important;
195
- color: #000 !important; /* Siyah */
196
  }
197
 
198
  .final-answer {
@@ -200,7 +196,6 @@ body, .gradio-container {
200
  font-weight: bold;
201
  text-align: center;
202
  margin: 20px;
203
- color: #000 !important; /* Siyah */
204
  }
205
 
206
  .button-group {
@@ -215,6 +210,13 @@ footer, .footer, .gradio-footer {
215
  }
216
  """
217
 
 
 
 
 
 
 
 
218
  # Yerel ikonu Base64'e çevirme
219
  with open("tubitech-su.png", "rb") as image_file:
220
  encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
@@ -230,10 +232,11 @@ icon_html = f"""
230
  </div>
231
  """
232
 
233
- with gr.Blocks(css=css, theme=gr.themes.Default()) as demo:
 
234
  gr.Markdown("### TUBITECH # 9694 - Sea Creature Akinator", elem_classes="header-text")
235
 
236
- # show_label=False ve label="" ile ekstra çerçeveyi kapatıyoruz
237
  assistant_display = gr.Markdown(
238
  value="",
239
  label="",
 
57
  end_idx = assistant_message.index("</answer>")
58
  final_answer = assistant_message[start_idx:end_idx].strip()
59
  if final_answer:
 
60
  assistant_update = gr.update(visible=False)
61
  final_text = f"**My guess:** **{final_answer}**"
62
  answer_update = gr.update(visible=False)
 
64
  restart_update = gr.update(visible=False)
65
  continue_update = gr.update(visible=False)
66
  else:
 
67
  assistant_update = gr.update(visible=True, value=assistant_message)
68
  final_text = ""
69
  answer_update = gr.update(visible=True)
 
150
  background-position: center !important;
151
  background-repeat: no-repeat !important;
152
  background-attachment: fixed !important;
153
+ color: #333;
154
  }
155
 
156
  /* Üstteki başlık için stil */
 
158
  text-align: center;
159
  margin-top: 20px;
160
  font-size: 2em;
161
+ color: #4261a8;
162
  }
163
 
164
  /* Özel buton sınıfımız: my-button */
165
  .my-button {
166
+ background-color: #4261a8 !important;
167
+ color: #fff !important;
168
  border: none !important;
169
  transition: transform 0.3s, background-color 0.3s !important;
170
  }
 
181
  margin: 10px auto;
182
  width: 80%;
183
  text-align: center;
184
+ background-color: rgba(173, 216, 230, 0);
 
185
  }
186
 
187
  /* Gradio Markdown’un varsayılan arka planını şeffaf yapmak */
 
189
  background-color: transparent !important;
190
  box-shadow: none !important;
191
  border: none !important;
 
192
  }
193
 
194
  .final-answer {
 
196
  font-weight: bold;
197
  text-align: center;
198
  margin: 20px;
 
199
  }
200
 
201
  .button-group {
 
210
  }
211
  """
212
 
213
+ # Light mode zorunluluğu için ek CSS
214
+ custom_css = """
215
+ :root {
216
+ color-scheme: light;
217
+ }
218
+ """ + css
219
+
220
  # Yerel ikonu Base64'e çevirme
221
  with open("tubitech-su.png", "rb") as image_file:
222
  encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
 
232
  </div>
233
  """
234
 
235
+ with gr.Blocks(css=custom_css, theme=gr.themes.Default()) as demo:
236
+ # Üstteki başlık
237
  gr.Markdown("### TUBITECH # 9694 - Sea Creature Akinator", elem_classes="header-text")
238
 
239
+ # Arayüz elemanları
240
  assistant_display = gr.Markdown(
241
  value="",
242
  label="",