Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,15 +19,10 @@ from langchain.memory import ConversationBufferMemory
|
|
19 |
from langchain_core.runnables.history import RunnableWithMessageHistory
|
20 |
|
21 |
|
22 |
-
@st.cache_data
|
23 |
def get_df():
|
24 |
return pickle.load(open("ebesha_ticket_df.pkl", "rb"))
|
25 |
|
26 |
-
@st.cache_data
|
27 |
-
def get_unique_values():
|
28 |
-
exec(custom_unique_df_chain(llm=CustomLLM(repo_id="mistralai/Mixtral-8x7B-Instruct-v0.1", model_type='text-generation', api_token=API_TOKEN, stop=["\n<|","<|"]), df=st.session_state.df).invoke({"df_example":format_df(st.session_state.df.head(4))}))
|
29 |
-
return response
|
30 |
-
|
31 |
|
32 |
@st.cache_resource
|
33 |
def get_llm_chain():
|
@@ -44,8 +39,8 @@ if 'df' not in st.session_state:
|
|
44 |
|
45 |
|
46 |
if 'unique_values' not in st.session_state:
|
47 |
-
|
48 |
-
st.session_state.unique_values =
|
49 |
|
50 |
|
51 |
|
|
|
19 |
from langchain_core.runnables.history import RunnableWithMessageHistory
|
20 |
|
21 |
|
22 |
+
@st.cache_data(persist=False)
|
23 |
def get_df():
|
24 |
return pickle.load(open("ebesha_ticket_df.pkl", "rb"))
|
25 |
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
@st.cache_resource
|
28 |
def get_llm_chain():
|
|
|
39 |
|
40 |
|
41 |
if 'unique_values' not in st.session_state:
|
42 |
+
exec(custom_unique_df_chain(llm=CustomLLM(repo_id="mistralai/Mixtral-8x7B-Instruct-v0.1", model_type='text-generation', api_token=API_TOKEN, stop=["\n<|","<|"]), df=st.session_state.df).invoke({"df_example":format_df(st.session_state.df.head(4))}))
|
43 |
+
st.session_state.unique_values = response
|
44 |
|
45 |
|
46 |
|