MVPilgrim commited on
Commit
82f7507
·
1 Parent(s): 32636c4
Files changed (1) hide show
  1. app.py +25 -25
app.py CHANGED
@@ -21,8 +21,6 @@ import streamlit as st
21
  import subprocess
22
 
23
 
24
- st.markdown("<h1 style='text-align: center; color: #666666;'>Vector Database RAG Proof of Concept</h1>", unsafe_allow_html=True)
25
- st.markdown("<h6 style='text-align: center; color: #666666;'>V1</h6>", unsafe_allow_html=True)
26
 
27
  if 'logging' not in st.session_state:
28
  weaviate_logger = logging.getLogger("httpx")
@@ -51,6 +49,13 @@ if 'runStartup' not in st.session_state:
51
  st.session_state.runStartup = True
52
  runStartup()
53
 
 
 
 
 
 
 
 
54
  # Function to load the CSS file
55
  def load_css(file_name):
56
  with open(file_name) as f:
@@ -64,11 +69,6 @@ if 'load_css' not in st.session_state:
64
  st.markdown("<h1 style='text-align: center; color: #666666;'>Vector Database RAG Proof of Concept</h1>", unsafe_allow_html=True)
65
  st.markdown("<h6 style='text-align: center; color: #666666;'>V1</h6>", unsafe_allow_html=True)
66
 
67
- ######################################################################
68
- # MAINLINE
69
- #
70
- logger.info("#### MAINLINE ENTERED.")
71
-
72
  #pathString = "/Users/660565/KPSAllInOne/ProgramFilesX86/WebCopy/DownloadedWebSites/LLMPOC_HTML"
73
  pathString = "/app/inputDocs"
74
  chunks = []
@@ -80,25 +80,25 @@ webpageChunksDocNames = []
80
 
81
  ######################################################
82
  # Connect to the Weaviate vector database.
83
- if 'client' not in st.session_state:
84
- logger.info("#### Create Weaviate db client connection.")
85
- client = weaviate.WeaviateClient(
86
- connection_params=ConnectionParams.from_params(
87
- http_host="localhost",
88
- http_port="8080",
89
- http_secure=False,
90
- grpc_host="localhost",
91
- grpc_port="50051",
92
- grpc_secure=False
93
- ),
94
- additional_config=AdditionalConfig(
95
- timeout=Timeout(init=60, query=1800, insert=1800), # Values in seconds
96
- )
97
  )
98
- client.connect()
99
- st.session_state.client = client
100
- else:
101
- client = st.session_state.client
 
102
 
103
 
104
  #######################################################
 
21
  import subprocess
22
 
23
 
 
 
24
 
25
  if 'logging' not in st.session_state:
26
  weaviate_logger = logging.getLogger("httpx")
 
49
  st.session_state.runStartup = True
50
  runStartup()
51
 
52
+
53
+
54
+ ######################################################################
55
+ # MAINLINE
56
+ #
57
+ logger.info("#### MAINLINE ENTERED.")
58
+
59
  # Function to load the CSS file
60
  def load_css(file_name):
61
  with open(file_name) as f:
 
69
  st.markdown("<h1 style='text-align: center; color: #666666;'>Vector Database RAG Proof of Concept</h1>", unsafe_allow_html=True)
70
  st.markdown("<h6 style='text-align: center; color: #666666;'>V1</h6>", unsafe_allow_html=True)
71
 
 
 
 
 
 
72
  #pathString = "/Users/660565/KPSAllInOne/ProgramFilesX86/WebCopy/DownloadedWebSites/LLMPOC_HTML"
73
  pathString = "/app/inputDocs"
74
  chunks = []
 
80
 
81
  ######################################################
82
  # Connect to the Weaviate vector database.
83
+ #if 'client' not in st.session_state:
84
+ logger.info("#### Create Weaviate db client connection.")
85
+ client = weaviate.WeaviateClient(
86
+ connection_params=ConnectionParams.from_params(
87
+ http_host="localhost",
88
+ http_port="8080",
89
+ http_secure=False,
90
+ grpc_host="localhost",
91
+ grpc_port="50051",
92
+ grpc_secure=False
93
+ ),
94
+ additional_config=AdditionalConfig(
95
+ timeout=Timeout(init=60, query=1800, insert=1800), # Values in seconds
 
96
  )
97
+ )
98
+ client.connect()
99
+ # st.session_state.client = client
100
+ #else:
101
+ # client = st.session_state.client
102
 
103
 
104
  #######################################################