Spaces:
Sleeping
Sleeping
John Graham Reynolds
commited on
Commit
·
6e06674
1
Parent(s):
0e29746
remove env var testing
Browse files
app.py
CHANGED
@@ -27,19 +27,9 @@ EXAMPLE_PROMPTS = [
|
|
27 |
st.set_page_config(layout="wide")
|
28 |
st.title(TITLE)
|
29 |
|
30 |
-
# test env vars get output correctly - do we need to configure PAT access further?
|
31 |
-
st.markdown(DESCRIPTION)
|
32 |
-
st.markdown("\n")
|
33 |
-
st.write(DATABRICKS_HOST)
|
34 |
-
st.markdown("\n")
|
35 |
-
st.write(DATABRICKS_TOKEN)
|
36 |
-
st.markdown("\n")
|
37 |
-
st.write(VS_ENDPOINT_NAME)
|
38 |
-
st.markdown("\n")
|
39 |
-
|
40 |
# use this to format later
|
41 |
-
|
42 |
-
|
43 |
|
44 |
# Same embedding model we used to create embeddings of terms
|
45 |
# make sure we cache this so that it doesnt redownload each time, hindering Space start time if sleeping
|
@@ -56,33 +46,6 @@ vector_store = DatabricksVectorSearch(
|
|
56 |
results = vector_store.similarity_search(query="Tell me about what a data lake is.", k=5)
|
57 |
st.write(results)
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
# TODO *** configure to run only on prompt for verification?
|
62 |
-
# vsc = VectorSearchClient()
|
63 |
-
|
64 |
-
# question = "What is the data lake?"
|
65 |
-
# # question_2 = "What does EDW stand for?"
|
66 |
-
# # question_3 = "What does AIDET stand for?"
|
67 |
-
|
68 |
-
# deploy_client = deployments.get_deploy_client("databricks")
|
69 |
-
# response = deploy_client.predict(endpoint="databricks-bge-large-en", inputs={"input": [question]})
|
70 |
-
# embeddings = [e['embedding'] for e in response.data]
|
71 |
-
|
72 |
-
# results = vsc.get_index(VS_ENDPOINT_NAME, VS_INDEX_NAME).similarity_search(
|
73 |
-
# query_vector=embeddings[0],
|
74 |
-
# columns=["name", "description"],
|
75 |
-
# num_results=5)
|
76 |
-
|
77 |
-
# st.write(results)
|
78 |
-
|
79 |
-
|
80 |
-
# print(results)
|
81 |
-
# print("---------------------------------------")
|
82 |
-
# vumc_terms = results.get('result', {}).get('data_array', [])
|
83 |
-
# print(vumc_terms)
|
84 |
-
|
85 |
-
|
86 |
# DBRX mainbody minus functions
|
87 |
|
88 |
# main = st.container()
|
|
|
27 |
st.set_page_config(layout="wide")
|
28 |
st.title(TITLE)
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
# use this to format later
|
31 |
+
with open("style.css") as css:
|
32 |
+
st.markdown( f'<style>{css.read()}</style>' , unsafe_allow_html= True)
|
33 |
|
34 |
# Same embedding model we used to create embeddings of terms
|
35 |
# make sure we cache this so that it doesnt redownload each time, hindering Space start time if sleeping
|
|
|
46 |
results = vector_store.similarity_search(query="Tell me about what a data lake is.", k=5)
|
47 |
st.write(results)
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
# DBRX mainbody minus functions
|
50 |
|
51 |
# main = st.container()
|