Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +6 -3
src/streamlit_app.py
CHANGED
|
@@ -1,4 +1,8 @@
|
|
| 1 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import time
|
| 3 |
import streamlit as st
|
| 4 |
import pandas as pd
|
|
@@ -12,8 +16,7 @@ from gliner import GLiNER
|
|
| 12 |
from comet_ml import Experiment
|
| 13 |
import hashlib
|
| 14 |
|
| 15 |
-
|
| 16 |
-
os.environ['HF_HOME'] = '/tmp'
|
| 17 |
|
| 18 |
# --- Page Configuration and UI Elements ---
|
| 19 |
st.set_page_config(layout="wide", page_title="Named Entity Recognition App")
|
|
@@ -207,7 +210,7 @@ if 'df_ner' in st.session_state and not st.session_state.df_ner.empty:
|
|
| 207 |
def load_gliner_model():
|
| 208 |
"""Initializes and caches the GLiNER model for QA."""
|
| 209 |
try:
|
| 210 |
-
return GLiNER.from_pretrained("knowledgator/gliner-multitask-
|
| 211 |
except Exception as e:
|
| 212 |
st.error(f"Error loading the GLiNER model: {e}")
|
| 213 |
st.stop()
|
|
|
|
| 1 |
import os
|
| 2 |
+
os.environ['HF_HOME'] = '/tmp'
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
|
| 6 |
import time
|
| 7 |
import streamlit as st
|
| 8 |
import pandas as pd
|
|
|
|
| 16 |
from comet_ml import Experiment
|
| 17 |
import hashlib
|
| 18 |
|
| 19 |
+
|
|
|
|
| 20 |
|
| 21 |
# --- Page Configuration and UI Elements ---
|
| 22 |
st.set_page_config(layout="wide", page_title="Named Entity Recognition App")
|
|
|
|
| 210 |
def load_gliner_model():
|
| 211 |
"""Initializes and caches the GLiNER model for QA."""
|
| 212 |
try:
|
| 213 |
+
return GLiNER.from_pretrained("knowledgator/gliner-multitask-v2.0", device="cpu")
|
| 214 |
except Exception as e:
|
| 215 |
st.error(f"Error loading the GLiNER model: {e}")
|
| 216 |
st.stop()
|