degbu embeddings
Browse files
app.py
CHANGED
|
@@ -14,6 +14,7 @@ from llama_index.core import (
|
|
| 14 |
Settings,
|
| 15 |
)
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
from llama_parse import LlamaParse
|
| 19 |
|
|
@@ -76,7 +77,7 @@ with st.sidebar:
|
|
| 76 |
# Enter LLM Token
|
| 77 |
llm_token = st.text_input(
|
| 78 |
"Enter your LLM token",
|
| 79 |
-
value=
|
| 80 |
)
|
| 81 |
|
| 82 |
# Create LLM
|
|
@@ -101,7 +102,7 @@ with st.sidebar:
|
|
| 101 |
# Enter parsing Token
|
| 102 |
parse_token = st.text_input(
|
| 103 |
"Enter your LlamaParse token",
|
| 104 |
-
value=
|
| 105 |
)
|
| 106 |
|
| 107 |
uploaded_file = st.file_uploader(
|
|
@@ -142,8 +143,8 @@ with col1:
|
|
| 142 |
|
| 143 |
st.divider()
|
| 144 |
|
| 145 |
-
index = VectorStoreIndex.from_documents(parsed_document)
|
| 146 |
-
query_engine = index.as_query_engine()
|
| 147 |
|
| 148 |
prompt_txt = 'Summarize this document in a 3-5 sentences.'
|
| 149 |
prompt = st.text_area(
|
|
@@ -152,8 +153,8 @@ with col1:
|
|
| 152 |
value=prompt_txt
|
| 153 |
)
|
| 154 |
|
| 155 |
-
response = qa_engine.query(prompt)
|
| 156 |
-
st.write(response.response)
|
| 157 |
|
| 158 |
with col2:
|
| 159 |
tab1, tab2 = st.tabs(["Uploaded File", "Parsed File",])
|
|
|
|
| 14 |
Settings,
|
| 15 |
)
|
| 16 |
|
| 17 |
+
os.environ["OPENAI_API_KEY"] = "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"
|
| 18 |
|
| 19 |
from llama_parse import LlamaParse
|
| 20 |
|
|
|
|
| 77 |
# Enter LLM Token
|
| 78 |
llm_token = st.text_input(
|
| 79 |
"Enter your LLM token",
|
| 80 |
+
value="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"
|
| 81 |
)
|
| 82 |
|
| 83 |
# Create LLM
|
|
|
|
| 102 |
# Enter parsing Token
|
| 103 |
parse_token = st.text_input(
|
| 104 |
"Enter your LlamaParse token",
|
| 105 |
+
value="llx-uxxwLr1gZmDibaHTl99ISQJtpLSjjfhgDvnosGxu92RdRlb7"
|
| 106 |
)
|
| 107 |
|
| 108 |
uploaded_file = st.file_uploader(
|
|
|
|
| 143 |
|
| 144 |
st.divider()
|
| 145 |
|
| 146 |
+
# index = VectorStoreIndex.from_documents(parsed_document)
|
| 147 |
+
# query_engine = index.as_query_engine()
|
| 148 |
|
| 149 |
prompt_txt = 'Summarize this document in a 3-5 sentences.'
|
| 150 |
prompt = st.text_area(
|
|
|
|
| 153 |
value=prompt_txt
|
| 154 |
)
|
| 155 |
|
| 156 |
+
# response = qa_engine.query(prompt)
|
| 157 |
+
# st.write(response.response)
|
| 158 |
|
| 159 |
with col2:
|
| 160 |
tab1, tab2 = st.tabs(["Uploaded File", "Parsed File",])
|