Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -19,8 +19,8 @@ print("hfh", huggingface_hub.__version__)
|
|
19 |
|
20 |
|
21 |
|
22 |
-
os.system("git config --global user.name \"Carlos Diaz\"")
|
23 |
-
os.system("git config --global user.email \"[email protected]\"")
|
24 |
|
25 |
|
26 |
repo = Repository(
|
@@ -28,7 +28,7 @@ repo = Repository(
|
|
28 |
)
|
29 |
|
30 |
|
31 |
-
index_name = "./kionlinde.json"
|
32 |
documents_folder = "./documents"
|
33 |
#@st.experimental_memo
|
34 |
#@st.cache_resource
|
@@ -43,6 +43,7 @@ def initialize_index(index_name, documents_folder):
|
|
43 |
documents = SimpleDirectoryReader(documents_folder).load_data()
|
44 |
index = GPTSimpleVectorIndex.from_documents(documents, service_context=service_context)
|
45 |
index.save_to_disk(index_name)
|
|
|
46 |
|
47 |
return index
|
48 |
|
@@ -107,7 +108,7 @@ text = st.text_input("Query text:", value="What type of tires sizes, front, rear
|
|
107 |
if st.button("Run Query") and text is not None:
|
108 |
|
109 |
response = query_index(index, "Act as a KION equipment expert:" + text)
|
110 |
-
myhtml = store_message(text, response)
|
111 |
st.markdown(response)
|
112 |
|
113 |
llm_col, embed_col = st.columns(2)
|
|
|
19 |
|
20 |
|
21 |
|
22 |
+
#os.system("git config --global user.name \"Carlos Diaz\"")
|
23 |
+
#os.system("git config --global user.email \"[email protected]\"")
|
24 |
|
25 |
|
26 |
repo = Repository(
|
|
|
28 |
)
|
29 |
|
30 |
|
31 |
+
index_name = "./data/kionlinde.json"
|
32 |
documents_folder = "./documents"
|
33 |
#@st.experimental_memo
|
34 |
#@st.cache_resource
|
|
|
43 |
documents = SimpleDirectoryReader(documents_folder).load_data()
|
44 |
index = GPTSimpleVectorIndex.from_documents(documents, service_context=service_context)
|
45 |
index.save_to_disk(index_name)
|
46 |
+
index.save_to_disk(DATA_FILE)
|
47 |
|
48 |
return index
|
49 |
|
|
|
108 |
if st.button("Run Query") and text is not None:
|
109 |
|
110 |
response = query_index(index, "Act as a KION equipment expert:" + text)
|
111 |
+
#myhtml = store_message(text, response)
|
112 |
st.markdown(response)
|
113 |
|
114 |
llm_col, embed_col = st.columns(2)
|