Upload app.py
Browse files
app.py
CHANGED
@@ -33,7 +33,7 @@ def get_text_file(text_docs):
|
|
33 |
temp_dir = tempfile.TemporaryDirectory() # ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํฉ๋๋ค.
|
34 |
temp_filepath = os.path.join(temp_dir.name, text_docs.name) # ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
35 |
|
36 |
-
with open(temp_filepath, "wb"
|
37 |
f.write(text_docs.getvalue()) # ํ
์คํธ ๋ฌธ์์ ๋ด์ฉ์ ์์ ํ์ผ์ ์๋๋ค.
|
38 |
|
39 |
text_loader = TextLoader(temp_filepath) # TextLoader๋ฅผ ์ฌ์ฉํด ํ
์คํธ ๋ฌธ์๋ฅผ ๋ก๋ํฉ๋๋ค.
|
@@ -55,7 +55,7 @@ def get_json_file(json_docs):
|
|
55 |
temp_dir = tempfile.TemporaryDirectory() # ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํฉ๋๋ค.
|
56 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name) # ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
57 |
|
58 |
-
with open(temp_filepath, "wb"
|
59 |
f.write(json_docs.getvalue()) # JSON ๋ฌธ์์ ๋ด์ฉ์ ์์ ํ์ผ์ ์๋๋ค.
|
60 |
|
61 |
json_loader = JSONLoader(temp_filepath) # JSONLoader๋ฅผ ์ฌ์ฉํด JSON ๋ฌธ์๋ฅผ ๋ก๋ํฉ๋๋ค.
|
|
|
33 |
temp_dir = tempfile.TemporaryDirectory() # ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํฉ๋๋ค.
|
34 |
temp_filepath = os.path.join(temp_dir.name, text_docs.name) # ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
35 |
|
36 |
+
with open(temp_filepath, "wb") as f: # ์์ ํ์ผ์ ํ
์คํธ ์ฐ๊ธฐ ๋ชจ๋๋ก ์ฝ๋๋ค.
|
37 |
f.write(text_docs.getvalue()) # ํ
์คํธ ๋ฌธ์์ ๋ด์ฉ์ ์์ ํ์ผ์ ์๋๋ค.
|
38 |
|
39 |
text_loader = TextLoader(temp_filepath) # TextLoader๋ฅผ ์ฌ์ฉํด ํ
์คํธ ๋ฌธ์๋ฅผ ๋ก๋ํฉ๋๋ค.
|
|
|
55 |
temp_dir = tempfile.TemporaryDirectory() # ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํฉ๋๋ค.
|
56 |
temp_filepath = os.path.join(temp_dir.name, json_docs.name) # ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
57 |
|
58 |
+
with open(temp_filepath, "wb") as f: # ์์ ํ์ผ์ ํ
์คํธ ์ฐ๊ธฐ ๋ชจ๋๋ก ์ฝ๋๋ค.
|
59 |
f.write(json_docs.getvalue()) # JSON ๋ฌธ์์ ๋ด์ฉ์ ์์ ํ์ผ์ ์๋๋ค.
|
60 |
|
61 |
json_loader = JSONLoader(temp_filepath) # JSONLoader๋ฅผ ์ฌ์ฉํด JSON ๋ฌธ์๋ฅผ ๋ก๋ํฉ๋๋ค.
|