Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
31 |
from langchain.memory import ConversationBufferMemory
|
32 |
from langchain.prompts import PromptTemplate
|
33 |
import joblib
|
34 |
-
|
35 |
|
36 |
import nest_asyncio # noqa: E402
|
37 |
nest_asyncio.apply()
|
@@ -49,6 +49,12 @@ groq_api_key=os.getenv('GROQ_API_KEY')
|
|
49 |
|
50 |
st.set_page_config(layout="wide")
|
51 |
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
css = """
|
53 |
<style>
|
54 |
[data-testid="stAppViewContainer"] {
|
|
|
31 |
from langchain.memory import ConversationBufferMemory
|
32 |
from langchain.prompts import PromptTemplate
|
33 |
import joblib
|
34 |
+
import nltk
|
35 |
|
36 |
import nest_asyncio # noqa: E402
|
37 |
nest_asyncio.apply()
|
|
|
49 |
|
50 |
st.set_page_config(layout="wide")
|
51 |
|
52 |
+
# Check and download the resource if it's not already available
|
53 |
+
try:
|
54 |
+
nltk.data.find('taggers/averaged_perceptron_tagger')
|
55 |
+
except LookupError:
|
56 |
+
nltk.download('averaged_perceptron_tagger')
|
57 |
+
|
58 |
css = """
|
59 |
<style>
|
60 |
[data-testid="stAppViewContainer"] {
|