Spaces:
Runtime error
Runtime error
se0kcess commited on
Commit ยท
950d69e
1
Parent(s): 93090c0
"update"
Browse files23 unmodified lines2425262728293031323334353637383923 unmodified lines# ๊ณผ์ # ์๋ ํ ์คํธ ์ถ์ถ ํจ์๋ฅผ ์์ฑimport osimport tempfiledef get_text_file(txt_docs):temp_dir = tempfile.TemporaryDirectory()temp_filepath = os.path.join(temp_dir.name, txt_docs.name)with open(temp_filepath, "w", encoding="utf-8") as f:f.write(txt_docs.getvalue())txt_loader = TextLoader(temp_filepath)return txt_loader# CSV ํ์ผ๋ก๋ถํฐ ํ ์คํธ๋ฅผ ์ถ์ถํ๋ ํจ์def get_csv_file(docs):23 unmodified lines242526272829303132333435363738394023 unmodified lines# ๊ณผ์ # ์๋ ํ ์คํธ ์ถ์ถ ํจ์๋ฅผ ์์ฑdef get_text_file(txt_docs):temp_dir = tempfile.TemporaryDirectory()temp_filepath = os.path.join(temp_dir.name, txt_docs.name)with open(temp_filepath, "w", encoding="utf-8") as f:f.write(txt_docs.getvalue())txt_loader = TextLoader(temp_filepath)txt_doc = txt_loader.load()return txt_doc# CSV ํ์ผ๋ก๋ถํฐ ํ ์คํธ๋ฅผ ์ถ์ถํ๋ ํจ์def get_csv_file(docs):
app.py+5-4