stefanoviel
commited on
Commit
·
6611ead
1
Parent(s):
7a417b0
tmp for sentence transformer
Browse files- src/streamlit_app.py +6 -2
src/streamlit_app.py
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import pandas as pd
|
| 3 |
from sentence_transformers import SentenceTransformer, util
|
| 4 |
import torch
|
| 5 |
-
import os
|
| 6 |
from spellchecker import SpellChecker # Import the spellchecker library
|
| 7 |
from io import StringIO
|
| 8 |
|
|
@@ -186,4 +190,4 @@ try:
|
|
| 186 |
|
| 187 |
except Exception as e:
|
| 188 |
st.error(f"An error occurred: {e}")
|
| 189 |
-
st.info("Please ensure all required libraries are installed (`pip install streamlit pandas sentence-transformers torch pyspellchecker`) and try again.")
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
# Set the cache directory for Hugging Face models to a writeable path
|
| 3 |
+
# This needs to be done before importing sentence_transformers
|
| 4 |
+
os.environ['TRANSFORMERS_CACHE'] = '/tmp'
|
| 5 |
+
|
| 6 |
import streamlit as st
|
| 7 |
import pandas as pd
|
| 8 |
from sentence_transformers import SentenceTransformer, util
|
| 9 |
import torch
|
|
|
|
| 10 |
from spellchecker import SpellChecker # Import the spellchecker library
|
| 11 |
from io import StringIO
|
| 12 |
|
|
|
|
| 190 |
|
| 191 |
except Exception as e:
|
| 192 |
st.error(f"An error occurred: {e}")
|
| 193 |
+
st.info("Please ensure all required libraries are installed (`pip install streamlit pandas sentence-transformers torch pyspellchecker`) and try again.")
|