Tenefix commited on
Commit
82ce094
·
verified ·
1 Parent(s): bf999fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -2,6 +2,10 @@ import gradio as gr
2
  from predictor import predict, key_already_generated, pre_process_encrypt_send_purchase, decrypt_prediction
3
  import base64
4
 
 
 
 
 
5
  def encode_image_to_base64(image_path):
6
  with open(image_path, "rb") as image_file:
7
  return base64.b64encode(image_file.read()).decode("utf-8")
@@ -27,8 +31,8 @@ def key_generated():
27
  demo = gr.Blocks(css=".markdown-body { font-size: 18px; }")
28
 
29
  with demo:
30
- zama_base64 = encode_image_to_base64("Img/zama.png")
31
- epita_base64 = encode_image_to_base64("Img/Epita.png")
32
 
33
  gr.Markdown(
34
  f"""
 
2
  from predictor import predict, key_already_generated, pre_process_encrypt_send_purchase, decrypt_prediction
3
  import base64
4
 
5
+ import os
6
+ zama_path = os.path.join(os.path.dirname(__file__), "Img", "zama.png")
7
+ epita_path = os.path.join(os.path.dirname(__file__), "Img", "Epita.png")
8
+
9
  def encode_image_to_base64(image_path):
10
  with open(image_path, "rb") as image_file:
11
  return base64.b64encode(image_file.read()).decode("utf-8")
 
31
  demo = gr.Blocks(css=".markdown-body { font-size: 18px; }")
32
 
33
  with demo:
34
+ zama_base64 = encode_image_to_base64(zama_path)
35
+ epita_base64 = encode_image_to_base64(epita_path)
36
 
37
  gr.Markdown(
38
  f"""