Ziptoze commited on
Commit
5613799
·
verified ·
1 Parent(s): 000d907

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -4
app.py CHANGED
@@ -255,12 +255,23 @@ else:
255
  custom_css = """
256
  /* Dark Purple Gradient Background */
257
  body, .gradio-container {
258
- background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e);
 
259
  background-size: 400% 400%;
260
  animation: gradient 15s ease infinite;
261
  color: #e0e7ff !important;
262
  }
263
 
 
 
 
 
 
 
 
 
 
 
264
  @keyframes gradient {
265
  0% { background-position: 0% 50%; }
266
  50% { background-position: 100% 50%; }
@@ -350,7 +361,9 @@ with gr.Blocks(title="Ultra OCR", theme=theme, css=custom_css) as demo:
350
  label="📄 Document Source",
351
  height=500,
352
  sources=['upload', 'clipboard'],
353
- format="png"
 
 
354
  )
355
  run_btn = gr.Button("⚡ Start Transcription", variant="primary", size="lg")
356
 
@@ -385,7 +398,9 @@ with gr.Blocks(title="Ultra OCR", theme=theme, css=custom_css) as demo:
385
  )
386
 
387
  if __name__ == "__main__":
388
- # Removed ssr_mode=False as it breaks some interactions on Spaces
 
389
  demo.launch(
390
- allowed_paths=[os.path.dirname(os.path.abspath(__file__))]
 
391
  )
 
255
  custom_css = """
256
  /* Dark Purple Gradient Background */
257
  body, .gradio-container {
258
+ background-color: #0f0c29 !important; /* Fallback */
259
+ background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e) !important;
260
  background-size: 400% 400%;
261
  animation: gradient 15s ease infinite;
262
  color: #e0e7ff !important;
263
  }
264
 
265
+ /* Fix for Image Components having weird background/glitches */
266
+ .gradio-container button.svelte-1pel5v0, .gradio-container img.svelte-1pel5v0 {
267
+ z-index: 100;
268
+ }
269
+ /* Ensure images sit on top of glass effects */
270
+ div[data-testid="image"] {
271
+ background: transparent !important;
272
+ backdrop-filter: none !important;
273
+ }
274
+
275
  @keyframes gradient {
276
  0% { background-position: 0% 50%; }
277
  50% { background-position: 100% 50%; }
 
361
  label="📄 Document Source",
362
  height=500,
363
  sources=['upload', 'clipboard'],
364
+ format="png",
365
+ show_label=True,
366
+ image_mode="RGB"
367
  )
368
  run_btn = gr.Button("⚡ Start Transcription", variant="primary", size="lg")
369
 
 
398
  )
399
 
400
  if __name__ == "__main__":
401
+ # Fix for spaces visual/SSR errors: Disable SSR (Server Side Rendering)
402
+ # This fixes "weird UI" glitches and image compatibility issues on modern Gradio versions
403
  demo.launch(
404
+ allowed_paths=[os.path.dirname(os.path.abspath(__file__))],
405
+ ssr_mode=False
406
  )