Spaces:
Sleeping
Sleeping
fixes
Browse filesFiles changed (4)
55 unmodified lines56575855 unmodified lines# Streamlit.streamlit/55 unmodified lines5657585955 unmodified lines# Streamlit.streamlit/!.streamlit/config.toml
32 unmodified lines333435363732 unmodified linesopenai>=1.0.0streamlittorch==2.8.0huggingface_hub32 unmodified lines3334353632 unmodified linesopenai>=1.0.0streamlithuggingface_hub
23 unmodified lines242526272829303123 unmodified lines)logger = logging.getLogger(__name__)nltk.download("stopwords")STOPWORDS = set(stopwords.words("english"))os.environ["TOKENIZERS_PARALLELISM"] = "false"# ...rest of your imports...23 unmodified lines242526272829303132333435363738394041424323 unmodified lines)logger = logging.getLogger(__name__)# Set NLTK data path to a writable directorynltk_data_dir = os.path.join(os.getcwd(), "nltk_data")if not os.path.exists(nltk_data_dir):os.makedirs(nltk_data_dir)nltk.data.path.append(nltk_data_dir)# Download to the custom directorytry:nltk.download("stopwords", download_dir=nltk_data_dir)STOPWORDS = set(stopwords.words("english"))except Exception as e:print(f"NLTK download failed: {e}")# Fallback to basic English stopwordsSTOPWORDS = set(['i', 'me', 'my', 'myself', 'we', 'our', 'ours', 'ourselves', 'you', 'your', 'yours', 'yourself', 'yourselves', 'he', 'him', 'his', 'himself', 'she', 'her', 'hers', 'herself', 'it', 'its', 'itself', 'they', 'them', 'their', 'theirs', 'themselves', 'what', 'which', 'who', 'whom', 'this', 'that', 'these', 'those', 'am', 'is', 'are', 'was', 'were', 'be', 'been', 'being', 'have', 'has', 'had', 'having', 'do', 'does', 'did', 'doing', 'a', 'an', 'the', 'and', 'but', 'if', 'or', 'because', 'as', 'until', 'while', 'of', 'at', 'by', 'for', 'with', 'through', 'during', 'before', 'after', 'above', 'below', 'up', 'down', 'in', 'out', 'on', 'off', 'over', 'under', 'again', 'further', 'then', 'once'])os.environ["TOKENIZERS_PARALLELISM"] = "false"# ...rest of your imports...
3 unmodified lines456789103 unmodified linesimport torchimport osfrom dotenv import load_dotenvfrom transformers import AutoModelForCausalLM, AutoTokenizerfrom peft import PeftModelfrom search_final import rag_pipeline3 unmodified lines4567891011121314153 unmodified linesimport torchimport osfrom dotenv import load_dotenvtry:from transformers import AutoModelForCausalLM, AutoTokenizerexcept ImportError as e:st.error(f"Error importing transformers: {e}")st.error("Please ensure transformers library is properly installed.")st.stop()from peft import PeftModelfrom search_final import rag_pipeline
.gitignore+1
requirements.txt-1
src/search_final.py+14-2
src/streamlit_app.py+6-1