Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -57,10 +57,11 @@ def get_json_file(json_docs):
|
|
| 57 |
with open(temp_filepath, "wb") as f:
|
| 58 |
f.write(json_docs.read()) # Write the content of the uploaded JSON file to the temporary file.
|
| 59 |
|
| 60 |
-
|
| 61 |
-
|
|
|
|
|
|
|
| 62 |
return data
|
| 63 |
-
pass
|
| 64 |
|
| 65 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
| 66 |
def get_text_chunks(documents):
|
|
|
|
| 57 |
with open(temp_filepath, "wb") as f:
|
| 58 |
f.write(json_docs.read()) # Write the content of the uploaded JSON file to the temporary file.
|
| 59 |
|
| 60 |
+
loader = JSONLoader(file_path=temp_filepath, jq_schema='.messages[].content', text_content=False)
|
| 61 |
+
data = loader.load()
|
| 62 |
+
|
| 63 |
+
pprint(data) # Use pprint directly on the loaded data.
|
| 64 |
return data
|
|
|
|
| 65 |
|
| 66 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
| 67 |
def get_text_chunks(documents):
|