Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,20 +29,6 @@ logger = logging.getLogger(__name__)
|
|
| 29 |
EMBEDDING_MODEL_NAME = "thenlper/gte-base"
|
| 30 |
CHUNK_SIZE = 500
|
| 31 |
BATCH_SIZE = 32
|
| 32 |
-
USE_GPU = torch.cuda.is_available()
|
| 33 |
-
|
| 34 |
-
# === Custom Exceptions ===
|
| 35 |
-
class ModelLoadingError(Exception):
|
| 36 |
-
pass
|
| 37 |
-
|
| 38 |
-
class FileProcessingError(Exception):
|
| 39 |
-
pass
|
| 40 |
-
|
| 41 |
-
class GPUQuotaExceededError(Exception):
|
| 42 |
-
pass
|
| 43 |
-
|
| 44 |
-
class VectorDBError(Exception):
|
| 45 |
-
pass
|
| 46 |
|
| 47 |
# Model initialization
|
| 48 |
model = None
|
|
@@ -164,7 +150,7 @@ def create_gradio_interface():
|
|
| 164 |
with gr.Blocks() as demo:
|
| 165 |
gr.Markdown("## Email Chunk Embeddings Generator")
|
| 166 |
|
| 167 |
-
error_box = gr.Textbox(visible=False, label="Status/Error Messages")
|
| 168 |
|
| 169 |
with gr.Row():
|
| 170 |
file_input = gr.File(
|
|
@@ -195,7 +181,7 @@ def create_gradio_interface():
|
|
| 195 |
process_button.click(
|
| 196 |
process_files,
|
| 197 |
inputs=[file_input],
|
| 198 |
-
outputs=[output_text, error_box, error_box]
|
| 199 |
)
|
| 200 |
|
| 201 |
return demo
|
|
|
|
| 29 |
EMBEDDING_MODEL_NAME = "thenlper/gte-base"
|
| 30 |
CHUNK_SIZE = 500
|
| 31 |
BATCH_SIZE = 32
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
# Model initialization
|
| 34 |
model = None
|
|
|
|
| 150 |
with gr.Blocks() as demo:
|
| 151 |
gr.Markdown("## Email Chunk Embeddings Generator")
|
| 152 |
|
| 153 |
+
error_box = gr.Textbox(visible=False, label="Status/Error Messages")
|
| 154 |
|
| 155 |
with gr.Row():
|
| 156 |
file_input = gr.File(
|
|
|
|
| 181 |
process_button.click(
|
| 182 |
process_files,
|
| 183 |
inputs=[file_input],
|
| 184 |
+
outputs=[output_text, error_box, error_box]
|
| 185 |
)
|
| 186 |
|
| 187 |
return demo
|