Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +2 -1
src/streamlit_app.py
CHANGED
|
@@ -114,7 +114,8 @@ category_mapping = {
|
|
| 114 |
"Temporal & Events": ["Date", "Transportation_Mode"],
|
| 115 |
"Locations": ["Location"]}
|
| 116 |
# --- Model Loading ---
|
| 117 |
-
@st.
|
|
|
|
| 118 |
"""Loads the GLiNER model and caches it."""
|
| 119 |
try:
|
| 120 |
return GLiNER.from_pretrained("gliner-community/gliner_large-v2.5", nested_ner=True, num_gen_sequences=2, gen_constraints= labels)
|
|
|
|
| 114 |
"Temporal & Events": ["Date", "Transportation_Mode"],
|
| 115 |
"Locations": ["Location"]}
|
| 116 |
# --- Model Loading ---
|
| 117 |
+
@st.cache_resource
|
| 118 |
+
def load_ner_model():
|
| 119 |
"""Loads the GLiNER model and caches it."""
|
| 120 |
try:
|
| 121 |
return GLiNER.from_pretrained("gliner-community/gliner_large-v2.5", nested_ner=True, num_gen_sequences=2, gen_constraints= labels)
|