Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -56,10 +56,10 @@ st.header("Review Scorer & Report Generator")
|
|
56 |
st.write("This model will score your reviews in your CSV file and generate a report based on those results.")
|
57 |
|
58 |
# Load models with caching to avoid reloading on every run
|
59 |
-
|
60 |
def load_models():
|
61 |
try:
|
62 |
-
score_pipe = pipeline("text-classification", model="
|
63 |
except Exception as e:
|
64 |
st.error(f"Error loading score model: {e}")
|
65 |
score_pipe = None
|
|
|
56 |
st.write("This model will score your reviews in your CSV file and generate a report based on those results.")
|
57 |
|
58 |
# Load models with caching to avoid reloading on every run
|
59 |
+
@st.cache_resource
|
60 |
def load_models():
|
61 |
try:
|
62 |
+
score_pipe = pipeline("text-classification", model="meta-llama/Prompt-Guard-86M", device=0)
|
63 |
except Exception as e:
|
64 |
st.error(f"Error loading score model: {e}")
|
65 |
score_pipe = None
|