buraktrk commited on
Commit
d8c9ca6
·
verified ·
1 Parent(s): 6b63df3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -264,7 +264,7 @@ def run_fhe():
264
  encrypted_result.append(result)
265
 
266
  encrypted_output = encrypted_result
267
- fhe_prediction_ready = True # 🎯 flag aktif ediliyor
268
  return "Gerçek tahmin tamamlandı."
269
 
270
 
@@ -272,7 +272,7 @@ def run_fhe():
272
 
273
  def run_simulate_direct(file):
274
  global simulate_prediction
275
- simulate_prediction = [] # 🔄 Önceki sonucu temizle
276
 
277
  if file is None:
278
  raise gr.Error("Lütfen bir Excel dosyası yükleyin.")
@@ -330,7 +330,7 @@ def decrypt_result():
330
  print(f"🎯 Sınıf listesi: {list(encoder.classes_)}")
331
 
332
  if len(raw) > 1:
333
- # Çok sınıflı olasılık çıktısı (örn. [0.1, 0.6, 0.2, 0.1])
334
  label_idx = int(np.argmax(raw))
335
  print(f"🔢 argmax sonucu: {label_idx}")
336
  else:
@@ -353,7 +353,6 @@ def decrypt_result():
353
 
354
 
355
  # -------------------- Gradio UI -------------------- #
356
- # Bilgilendirici başlangıç mesajı
357
  def fhe_start_message():
358
  return "Tahmin başlatıldı, lütfen bekleyin..."
359
 
@@ -403,7 +402,7 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="blue")) as demo:
403
  gr.Examples(examples=EXAMPLE_XLSX, inputs=file_in, label="Örnek Excel Seç", cache_examples=False)
404
 
405
  if __name__ == "__main__":
406
- # 🧹 UI temiz başlasın
407
  fhe_prediction_ready = False
408
  simulate_prediction = []
409
  encrypted_output = None
 
264
  encrypted_result.append(result)
265
 
266
  encrypted_output = encrypted_result
267
+ fhe_prediction_ready = True
268
  return "Gerçek tahmin tamamlandı."
269
 
270
 
 
272
 
273
  def run_simulate_direct(file):
274
  global simulate_prediction
275
+ simulate_prediction = []
276
 
277
  if file is None:
278
  raise gr.Error("Lütfen bir Excel dosyası yükleyin.")
 
330
  print(f"🎯 Sınıf listesi: {list(encoder.classes_)}")
331
 
332
  if len(raw) > 1:
333
+ # Çok sınıflı olasılık çıktısı
334
  label_idx = int(np.argmax(raw))
335
  print(f"🔢 argmax sonucu: {label_idx}")
336
  else:
 
353
 
354
 
355
  # -------------------- Gradio UI -------------------- #
 
356
  def fhe_start_message():
357
  return "Tahmin başlatıldı, lütfen bekleyin..."
358
 
 
402
  gr.Examples(examples=EXAMPLE_XLSX, inputs=file_in, label="Örnek Excel Seç", cache_examples=False)
403
 
404
  if __name__ == "__main__":
405
+
406
  fhe_prediction_ready = False
407
  simulate_prediction = []
408
  encrypted_output = None