Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -34,7 +34,7 @@ def get_json_file(docs):
|
|
34 |
temp_dir = tempfile.TemporaryDirectory()
|
35 |
temp_filepath = os.path.join(temp_dir.name, pdf_docs.name)
|
36 |
with open(temp_filepath, "wb") as f:
|
37 |
-
f.write(
|
38 |
|
39 |
|
40 |
loader = JSONLoader(
|
@@ -42,8 +42,8 @@ def get_json_file(docs):
|
|
42 |
jq_schema='.messages[].content',
|
43 |
text_content=False)
|
44 |
|
45 |
-
|
46 |
-
return
|
47 |
|
48 |
|
49 |
|
|
|
34 |
temp_dir = tempfile.TemporaryDirectory()
|
35 |
temp_filepath = os.path.join(temp_dir.name, pdf_docs.name)
|
36 |
with open(temp_filepath, "wb") as f:
|
37 |
+
f.write(json_docs.getvalue())
|
38 |
|
39 |
|
40 |
loader = JSONLoader(
|
|
|
42 |
jq_schema='.messages[].content',
|
43 |
text_content=False)
|
44 |
|
45 |
+
json_docs = loader.load()
|
46 |
+
return json_docs
|
47 |
|
48 |
|
49 |
|