SiddharthAK commited on
Commit
0c9e4b7
·
verified ·
1 Parent(s): 3356cfa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +61 -1
app.py CHANGED
@@ -5,6 +5,66 @@ import numpy as np
5
  from tqdm.auto import tqdm
6
  import os
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  # --- Model Loading ---
9
  tokenizer_splade = None
10
  model_splade = None
@@ -405,7 +465,7 @@ def calculate_dot_product_and_representations_independent(query_model_choice, do
405
 
406
 
407
  # --- Gradio Interface Setup with Tabs ---
408
- with gr.Blocks(title="SPLADE Demos") as demo:
409
  gr.Markdown("# 🌌 Sparse Encoder Playground") # Updated title
410
  gr.Markdown("Explore different SPLADE models and their sparse representation types, and calculate similarity between query and document representations.") # Updated description
411
 
 
5
  from tqdm.auto import tqdm
6
  import os
7
 
8
+
9
+
10
+ # Add this CSS at the top of your file, after the imports
11
+ css = """
12
+ /* Move share button to top-right corner */
13
+ .share-button {
14
+ position: fixed !important;
15
+ top: 20px !important;
16
+ right: 20px !important;
17
+ z-index: 1000 !important;
18
+ background: #4CAF50 !important;
19
+ color: white !important;
20
+ border-radius: 8px !important;
21
+ padding: 8px 16px !important;
22
+ font-weight: bold !important;
23
+ box-shadow: 0 2px 10px rgba(0,0,0,0.2) !important;
24
+ }
25
+
26
+ .share-button:hover {
27
+ background: #45a049 !important;
28
+ transform: translateY(-1px) !important;
29
+ }
30
+
31
+ /* Alternative positions - uncomment the one you want instead */
32
+
33
+ /* Top-left corner */
34
+ /*
35
+ .share-button {
36
+ position: fixed !important;
37
+ top: 20px !important;
38
+ left: 20px !important;
39
+ z-index: 1000 !important;
40
+ }
41
+ */
42
+
43
+ /* Bottom-right corner (mobile-friendly) */
44
+ /*
45
+ .share-button {
46
+ position: fixed !important;
47
+ bottom: 20px !important;
48
+ right: 20px !important;
49
+ z-index: 1000 !important;
50
+ }
51
+ */
52
+
53
+ /* Bottom-center */
54
+ /*
55
+ .share-button {
56
+ position: fixed !important;
57
+ bottom: 20px !important;
58
+ left: 50% !important;
59
+ transform: translateX(-50%) !important;
60
+ z-index: 1000 !important;
61
+ }
62
+ */
63
+ """
64
+
65
+
66
+
67
+
68
  # --- Model Loading ---
69
  tokenizer_splade = None
70
  model_splade = None
 
465
 
466
 
467
  # --- Gradio Interface Setup with Tabs ---
468
+ with gr.Blocks(title="SPLADE Demos", css=css) as demo:
469
  gr.Markdown("# 🌌 Sparse Encoder Playground") # Updated title
470
  gr.Markdown("Explore different SPLADE models and their sparse representation types, and calculate similarity between query and document representations.") # Updated description
471