Patryk Ptasiński commited on
Commit
7d3e0ef
·
1 Parent(s): 73c7e87

Add fixed height CSS for embedding output panel to prevent excessive page height

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -104,7 +104,16 @@ async def list_models():
104
  )
105
 
106
 
107
- with gr.Blocks(title="Multi-Model Text Embeddings") as app:
 
 
 
 
 
 
 
 
 
108
  gr.Markdown("# Multi-Model Text Embeddings")
109
  gr.Markdown("Generate embeddings for your text using 16+ state-of-the-art embedding models from Nomic, BGE, Snowflake, IBM Granite, and more.")
110
 
@@ -120,7 +129,7 @@ with gr.Blocks(title="Multi-Model Text Embeddings") as app:
120
  text_input = gr.Textbox(label="Enter text to embed", placeholder="Type or paste your text here...")
121
 
122
  # Create an output component to display the embedding
123
- output = gr.JSON(label="Text Embedding")
124
 
125
  # Add a submit button with API name
126
  submit_btn = gr.Button("Generate Embedding", variant="primary")
 
104
  )
105
 
106
 
107
+ with gr.Blocks(title="Multi-Model Text Embeddings", css="""
108
+ .json-holder {
109
+ max-height: 400px !important;
110
+ overflow-y: auto !important;
111
+ }
112
+ .json-holder .wrap {
113
+ max-height: 400px !important;
114
+ overflow-y: auto !important;
115
+ }
116
+ """) as app:
117
  gr.Markdown("# Multi-Model Text Embeddings")
118
  gr.Markdown("Generate embeddings for your text using 16+ state-of-the-art embedding models from Nomic, BGE, Snowflake, IBM Granite, and more.")
119
 
 
129
  text_input = gr.Textbox(label="Enter text to embed", placeholder="Type or paste your text here...")
130
 
131
  # Create an output component to display the embedding
132
+ output = gr.JSON(label="Text Embedding", elem_classes=["json-holder"])
133
 
134
  # Add a submit button with API name
135
  submit_btn = gr.Button("Generate Embedding", variant="primary")