prithivMLmods commited on
Commit
4a33ab7
·
verified ·
1 Parent(s): ace8af1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -19,6 +19,16 @@ from transformers import (
19
  TextIteratorStreamer,
20
  )
21
 
 
 
 
 
 
 
 
 
 
 
22
  # --- Constants and Model Setup ---
23
  MAX_INPUT_TOKEN_LENGTH = 4096
24
  device = "cuda" if torch.cuda.is_available() else "cpu"
@@ -166,7 +176,7 @@ def create_gradio_interface():
166
  .process-button { border: none !important; color: white !important; font-weight: bold !important; background-color: blue !important;}
167
  .process-button:hover { background-color: darkblue !important; transform: translateY(-2px) !important; box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important; }
168
  """
169
- with gr.Blocks(theme="bethecloud/storj_theme", css=css) as demo:
170
  gr.HTML("""
171
  <div class="title" style="text-align: center">
172
  <h1>Dot<span style="color: red;">●</span><strong></strong>OCR Comparator</h1>
 
19
  TextIteratorStreamer,
20
  )
21
 
22
+ js_func = """
23
+ function refresh() {
24
+ const url = new URL(window.location);
25
+ if (url.searchParams.get('__theme') !== 'dark') {
26
+ url.searchParams.set('__theme', 'dark');
27
+ window.location.href = url.href;
28
+ }
29
+ }
30
+ """
31
+
32
  # --- Constants and Model Setup ---
33
  MAX_INPUT_TOKEN_LENGTH = 4096
34
  device = "cuda" if torch.cuda.is_available() else "cpu"
 
176
  .process-button { border: none !important; color: white !important; font-weight: bold !important; background-color: blue !important;}
177
  .process-button:hover { background-color: darkblue !important; transform: translateY(-2px) !important; box-shadow: 0 4px 8px rgba(0,0,0,0.2) !important; }
178
  """
179
+ with gr.Blocks(theme="bethecloud/storj_theme", css=css, js=js_func) as demo:
180
  gr.HTML("""
181
  <div class="title" style="text-align: center">
182
  <h1>Dot<span style="color: red;">●</span><strong></strong>OCR Comparator</h1>