Spaces:
Runtime error
Runtime error
wnsdud030415 commited on
Commit ยท
ba08030
1
Parent(s): ca8ead2
push1
Browse files- app.py +9 -5
- htmlTemplates.py +1 -1
app.py
CHANGED
|
@@ -53,11 +53,15 @@ def get_csv_file(docs):
|
|
| 53 |
def get_json_file(docs):
|
| 54 |
temp_dir = tempfile.TemporaryDirectory() # ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํฉ๋๋ค.
|
| 55 |
temp_filepath = os.path.join(temp_dir.name, docs.name) # ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
| 56 |
-
with open(temp_filepath, "wb") as f:
|
| 57 |
-
f.write(docs.getvalue())
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
|
| 63 |
# ๋ฌธ์๋ค์ ์ฒ๋ฆฌํ์ฌ ํ
์คํธ ์ฒญํฌ๋ก ๋๋๋ ํจ์์
๋๋ค.
|
|
|
|
| 53 |
def get_json_file(docs):
|
| 54 |
temp_dir = tempfile.TemporaryDirectory() # ์์ ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํฉ๋๋ค.
|
| 55 |
temp_filepath = os.path.join(temp_dir.name, docs.name) # ์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์์ฑํฉ๋๋ค.
|
| 56 |
+
with open(temp_filepath, "wb") as f:
|
| 57 |
+
f.write(docs.getvalue())
|
| 58 |
+
f.seek(0)
|
| 59 |
+
json_loader = JSONLoader(f.name,
|
| 60 |
+
jq_schema='.scans[].relationships',
|
| 61 |
+
text_content=False)
|
| 62 |
+
json_doc = json_loader.load()
|
| 63 |
+
|
| 64 |
+
return json_doc
|
| 65 |
|
| 66 |
|
| 67 |
# ๋ฌธ์๋ค์ ์ฒ๋ฆฌํ์ฌ ํ
์คํธ ์ฒญํฌ๋ก ๋๋๋ ํจ์์
๋๋ค.
|
htmlTemplates.py
CHANGED
|
@@ -28,7 +28,7 @@ css = '''
|
|
| 28 |
bot_template = '''
|
| 29 |
<div class="chat-message bot">
|
| 30 |
<div class="avatar">
|
| 31 |
-
<img src="https://
|
| 32 |
</div>
|
| 33 |
<div class="message">{{MSG}}</div>
|
| 34 |
</div>
|
|
|
|
| 28 |
bot_template = '''
|
| 29 |
<div class="chat-message bot">
|
| 30 |
<div class="avatar">
|
| 31 |
+
<img src="https://huggingface.co/spaces/wnsdud030415/RAG_AI_Chatbot_assignment/blob/main/AI.webp" style="max-height: 78px; max-width: 78px; border-radius: 50%; object-fit: cover;">
|
| 32 |
</div>
|
| 33 |
<div class="message">{{MSG}}</div>
|
| 34 |
</div>
|