Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ def get_json_file(json_docs):
|
|
51 |
temp_filepath4 = os.path.join(temp_dir4.name, json_docs.name) # ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
52 |
with open(temp_filepath4, "wb") as f: # ์์ ํ์ผ์ ๋ฐ์ด๋๋ฆฌ ์ฐ๊ธฐ ๋ชจ๋๋ก ์ฝ๋๋ค.
|
53 |
f.write(json_docs.getvalue()) # json ๋ฌธ์์ ๋ด์ฉ์ ์์ ํ์ผ์ ์๋๋ค.
|
54 |
-
json_loader = JSONLoader(temp_filepath4) # JSONLoader๋ฅผ ์ฌ์ฉํด json๋ฅผ ๋ก๋ํฉ๋๋ค.
|
55 |
json_doc = json_loader.load() # ํ
์คํธ๋ฅผ ์ถ์ถํฉ๋๋ค.
|
56 |
return json_doc # ์ถ์ถํ ํ
์คํธ๋ฅผ ๋ฐํํฉ๋๋ค.
|
57 |
|
|
|
51 |
temp_filepath4 = os.path.join(temp_dir4.name, json_docs.name) # ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
52 |
with open(temp_filepath4, "wb") as f: # ์์ ํ์ผ์ ๋ฐ์ด๋๋ฆฌ ์ฐ๊ธฐ ๋ชจ๋๋ก ์ฝ๋๋ค.
|
53 |
f.write(json_docs.getvalue()) # json ๋ฌธ์์ ๋ด์ฉ์ ์์ ํ์ผ์ ์๋๋ค.
|
54 |
+
json_loader = JSONLoader(temp_filepath4, jq_schema='schema.json') # JSONLoader๋ฅผ ์ฌ์ฉํด json๋ฅผ ๋ก๋ํฉ๋๋ค.
|
55 |
json_doc = json_loader.load() # ํ
์คํธ๋ฅผ ์ถ์ถํฉ๋๋ค.
|
56 |
return json_doc # ์ถ์ถํ ํ
์คํธ๋ฅผ ๋ฐํํฉ๋๋ค.
|
57 |
|