Spaces:
Running
Running
Commit
Β·
37f0f41
1
Parent(s):
e9d10b3
Update app.py
Browse files
app.py
CHANGED
@@ -50,8 +50,9 @@ def get_json_file(docs):
|
|
50 |
text_list = []
|
51 |
|
52 |
for file in docs:
|
53 |
-
#
|
54 |
-
file_extension = mimetypes.guess_extension(file.
|
|
|
55 |
if file_extension == '.json':
|
56 |
# Read the JSON content from the file
|
57 |
json_content = json.loads(file.getvalue().decode('utf-8'))
|
@@ -66,9 +67,6 @@ def get_json_file(docs):
|
|
66 |
|
67 |
return text_list
|
68 |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
|
73 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
74 |
def get_text_chunks(documents):
|
|
|
50 |
text_list = []
|
51 |
|
52 |
for file in docs:
|
53 |
+
# Use mimetypes to guess the type based on the file name
|
54 |
+
file_extension = mimetypes.guess_extension(file.name)
|
55 |
+
|
56 |
if file_extension == '.json':
|
57 |
# Read the JSON content from the file
|
58 |
json_content = json.loads(file.getvalue().decode('utf-8'))
|
|
|
67 |
|
68 |
return text_list
|
69 |
|
|
|
|
|
|
|
70 |
|
71 |
# λ¬Έμλ€μ μ²λ¦¬νμ¬ ν
μ€νΈ μ²ν¬λ‘ λλλ ν¨μμ
λλ€.
|
72 |
def get_text_chunks(documents):
|