paulcalzada commited on
Commit
e0f0abd
·
verified ·
1 Parent(s): f6f239e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -16
app.py CHANGED
@@ -29,9 +29,6 @@ except Exception as e:
29
  with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) as demo:
30
  gr.Markdown("## DeepV for RTL Code Generation — Model-Agnostic (Bring Your Own API Key)", elem_id="main-title")
31
 
32
- # Serve the logo file correctly using gr.File
33
- logo_file = gr.File("DeepV_logo.png", visible=False, file_id="deepv-logo-file")
34
-
35
  with gr.Row():
36
  with gr.Column(scale=2):
37
  with gr.Row():
@@ -74,12 +71,12 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
74
  )
75
 
76
  with gr.Column(scale=3):
77
- # --- DeepV Logo and "Output" text ---
78
  with gr.Row(elem_id="logo-and-output-row"):
79
- # Container for the logo to allow layered animations
80
  gr.HTML("""
81
  <div id="logo-container">
82
- <img id="deepv-base-logo" alt="DeepV Logo">
83
  <div id="deep-part" class="logo-overlay"></div>
84
  </div>
85
  """)
@@ -172,16 +169,6 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
172
  """
173
  )
174
 
175
- # --- New JS/CSS to handle the logo paths
176
- demo.load(None, None, None, js="""
177
- function setLogoSrc() {
178
- var logo_url = window.__gradio_space__ + '/file=DeepV_logo.png';
179
- document.getElementById('deepv-base-logo').src = logo_url;
180
- document.getElementById('deep-part').style.backgroundImage = 'url(' + logo_url + ')';
181
- }
182
- window.addEventListener('load', setLogoSrc);
183
- """)
184
-
185
  demo.css = """
186
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap');
187
 
@@ -225,6 +212,8 @@ with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) a
225
  left: 0;
226
  width: 100%;
227
  height: 100%;
 
 
228
  background-size: contain;
229
  background-repeat: no-repeat;
230
  background-position: center;
 
29
  with gr.Blocks(title="DeepV for RTL (Model-Agnostic)", theme=gr.themes.Soft()) as demo:
30
  gr.Markdown("## DeepV for RTL Code Generation — Model-Agnostic (Bring Your Own API Key)", elem_id="main-title")
31
 
 
 
 
32
  with gr.Row():
33
  with gr.Column(scale=2):
34
  with gr.Row():
 
71
  )
72
 
73
  with gr.Column(scale=3):
74
+ # --- DeepV Logo and "Output" text (Correctly configured gr.Image) ---
75
  with gr.Row(elem_id="logo-and-output-row"):
76
+ # Use gr.HTML with correct relative paths for local files.
77
  gr.HTML("""
78
  <div id="logo-container">
79
+ <img src="file=DeepV_logo.png" id="deepv-base-logo" alt="DeepV Logo">
80
  <div id="deep-part" class="logo-overlay"></div>
81
  </div>
82
  """)
 
169
  """
170
  )
171
 
 
 
 
 
 
 
 
 
 
 
172
  demo.css = """
173
  @import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600&display=swap');
174
 
 
212
  left: 0;
213
  width: 100%;
214
  height: 100%;
215
+ /* CORRECTED: Use a URL that Gradio can resolve for assets */
216
+ background-image: url('file=DeepV_logo.png');
217
  background-size: contain;
218
  background-repeat: no-repeat;
219
  background-position: center;