Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,23 @@
|
|
| 1 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
#x = st.slider('Select a value')
|
| 4 |
-
#st.write(x, 'squared is', x * x)
|
| 5 |
|
| 6 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import warnings
|
| 3 |
+
warnings.filterwarnings('ignore')
|
| 4 |
+
import utils
|
| 5 |
+
|
| 6 |
+
import os
|
| 7 |
+
import openai
|
| 8 |
+
openai.api_key = utils.get_openai_api_key()
|
| 9 |
+
|
| 10 |
+
from llama_index import SimpleDirectoryReader
|
| 11 |
+
|
| 12 |
+
documents = SimpleDirectoryReader(
|
| 13 |
+
input_files=["./eBook-How-to-Build-a-Career-in-AI.pdf"]
|
| 14 |
+
).load_data()
|
| 15 |
+
|
| 16 |
+
print(type(documents), "\n")
|
| 17 |
+
print(len(documents), "\n")
|
| 18 |
+
print(type(documents[0]))
|
| 19 |
+
print(documents[0])
|
| 20 |
+
|
| 21 |
|
|
|
|
|
|
|
| 22 |
|
| 23 |
|