Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,20 +30,17 @@ def get_text_file(docs):
|
|
| 30 |
def get_csv_file(docs):
|
| 31 |
pass
|
| 32 |
|
| 33 |
-
def get_json_file(
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
with open(temp_filepath, "wb") as f:
|
| 37 |
-
f.write(json_docs.getvalue())
|
| 38 |
|
| 39 |
-
|
| 40 |
loader = JSONLoader(
|
| 41 |
-
file_path=
|
| 42 |
jq_schema='.messages[].content',
|
| 43 |
text_content=False)
|
| 44 |
|
| 45 |
-
|
| 46 |
-
return
|
| 47 |
|
| 48 |
|
| 49 |
|
|
|
|
| 30 |
def get_csv_file(docs):
|
| 31 |
pass
|
| 32 |
|
| 33 |
+
def get_json_file(docs):
|
| 34 |
+
file_path='./example_data/facebook_chat.json'
|
| 35 |
+
data = json.loads(Path(file_path).read_text())
|
|
|
|
|
|
|
| 36 |
|
|
|
|
| 37 |
loader = JSONLoader(
|
| 38 |
+
file_path='./example_data/facebook_chat.json',
|
| 39 |
jq_schema='.messages[].content',
|
| 40 |
text_content=False)
|
| 41 |
|
| 42 |
+
data = loader.load()
|
| 43 |
+
return data
|
| 44 |
|
| 45 |
|
| 46 |
|