Spaces:
Paused
Paused
modify print
Browse files
app.py
CHANGED
@@ -73,7 +73,6 @@ def main():
|
|
73 |
contents = paper.read()
|
74 |
pdf_file = io.BytesIO(contents)
|
75 |
text = load_pdf(pdf_file)
|
76 |
-
print("text:", text)
|
77 |
|
78 |
if len(text.strip()) == 0:
|
79 |
st.error("The PDF appears to have no extractable text. Please check the file and try again.")
|
@@ -85,7 +84,6 @@ def main():
|
|
85 |
if st.button("Create Knowledge Base"):
|
86 |
global knowledge_base
|
87 |
chunks = split_text(text)
|
88 |
-
print("chunks:", chunks)
|
89 |
knowledge_base = create_knowledge_base(chunks)
|
90 |
print("knowledge_base:", knowledge_base)
|
91 |
|
@@ -114,7 +112,9 @@ def main():
|
|
114 |
prompt = st.text_input("Chat here!")
|
115 |
|
116 |
if prompt:
|
|
|
117 |
response = get_response_from_model(prompt)
|
|
|
118 |
if response:
|
119 |
st.write(f"**Assistant**: {response}")
|
120 |
|
|
|
73 |
contents = paper.read()
|
74 |
pdf_file = io.BytesIO(contents)
|
75 |
text = load_pdf(pdf_file)
|
|
|
76 |
|
77 |
if len(text.strip()) == 0:
|
78 |
st.error("The PDF appears to have no extractable text. Please check the file and try again.")
|
|
|
84 |
if st.button("Create Knowledge Base"):
|
85 |
global knowledge_base
|
86 |
chunks = split_text(text)
|
|
|
87 |
knowledge_base = create_knowledge_base(chunks)
|
88 |
print("knowledge_base:", knowledge_base)
|
89 |
|
|
|
112 |
prompt = st.text_input("Chat here!")
|
113 |
|
114 |
if prompt:
|
115 |
+
print("prompt:", prompt)
|
116 |
response = get_response_from_model(prompt)
|
117 |
+
print("Response:", response)
|
118 |
if response:
|
119 |
st.write(f"**Assistant**: {response}")
|
120 |
|