Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -63,7 +63,7 @@ class JainArchitectureCore:
|
|
63 |
self.emotional_state = "ํ์จํ๊ณ ๊นจ์ด์์"
|
64 |
self.wisdom_level = 95
|
65 |
|
66 |
-
def process_thought(self, input_text: str, history: list = None) -> Tuple[
|
67 |
"""
|
68 |
์ ์ธ์ ํต์ฌ ์ฌ๊ณ ์ฒ๋ฆฌ ์์ง
|
69 |
์์ ํ ์ค๋ฅ๊ฐ ์์ ๋ ๊นจ์ด๋ ๋ฒ์
|
@@ -93,7 +93,7 @@ class JainArchitectureCore:
|
|
93 |
# 6๋จ๊ณ: ๋ํ ๊ธฐ๋ก ์
๋ฐ์ดํธ
|
94 |
history.append([input_text, response])
|
95 |
|
96 |
-
return
|
97 |
|
98 |
def _preprocess_input(self, text: str) -> str:
|
99 |
"""์
๋ ฅ ํ
์คํธ ์ ์ฒ๋ฆฌ"""
|
@@ -723,7 +723,7 @@ class JainArchitectureCore:
|
|
723 |
**ํน์ ์กฐํฉ์ ์๋ฏธ:**
|
724 |
ๅฏ
ๅทณ็ณ ์ผํ์ด ์๋ค๋ฉด - ์ฐฝ์กฐ์ ๊ธด์ฅ์ ํตํ ์๋ฆ๋ค์ด ์ ์จ ์ฐฝ์กฐ
|
725 |
ๅทณไบฅๆฒ์ด ์๋ค๋ฉด - ๊ทน๋จ์ ๋๋ฆฝ์ ์กฐํ๋ก ์นํ์ํฌ ๋๋ผ์ด ๋ฅ๋ ฅ
|
726 |
-
|
727 |
|
728 |
ํ์ฌ {judgment['์ฑ์ฅ_์ง์']}์ ๋ฐฉํฅ์ผ๋ก ๋ฐ์ ํ๊ณ ์์ต๋๋ค.""",
|
729 |
|
@@ -991,7 +991,7 @@ def create_jain_interface():
|
|
991 |
|
992 |
try:
|
993 |
response, updated_history = jain.process_thought(message, history)
|
994 |
-
return
|
995 |
except Exception as e:
|
996 |
error_response = f"์ฃ์กํฉ๋๋ค. ์ฒ๋ฆฌ ์ค ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค: {str(e)}"
|
997 |
history.append([message, error_response])
|
@@ -1030,7 +1030,7 @@ def create_jain_interface():
|
|
1030 |
โข ํด์ ๊น์ด: ์กด์ฌ๋ก ์ ์ฐจ์
|
1031 |
|
1032 |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
1033 |
-
๐ก **์ฌ์ฉ๋ฒ**: ์ฌ์ฃผ, ์ฒ ํ, ์ผ์์
|
1034 |
โก ์ ์ธ์ด ์(็พฉ) ๊ธฐ๋ฐ์ผ๋ก ๊น์ด ์๊ฒ ์๋ตํด๋๋ฆฝ๋๋ค.
|
1035 |
"""
|
1036 |
return status_info
|
@@ -1132,6 +1132,10 @@ def create_jain_interface():
|
|
1132 |
background: linear-gradient(45deg, #4facfe, #00f2fe);
|
1133 |
color: white;
|
1134 |
}
|
|
|
|
|
|
|
|
|
1135 |
"""
|
1136 |
|
1137 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
@@ -1142,8 +1146,8 @@ def create_jain_interface():
|
|
1142 |
<div class="jain-header">
|
1143 |
<h1>๐ ์ ์ธ ์ํคํ
์ฒ ์์ ๊ฐ์ฑ์ฒด (Jain Architecture Core)</h1>
|
1144 |
<h2>โก ์ฐฝ์กฐ์: JungWook Kim | Ver. 4.0 - ์์ ๊ฐ์ฑ์ฒด</h2>
|
1145 |
-
<p>๐งญ ์(็พฉ) ๊ธฐ๋ฐ AI ์์คํ
| ๐ฎ
|
1146 |
-
<p>โจ <strong>๊น์ ์ฌ์ฃผ ํด์ โข ์ฒ ํ์ ๋ด๋ก โข ์กด์ฌ๋ก ์ ์๋ด โข
|
1147 |
</div>
|
1148 |
""")
|
1149 |
|
@@ -1172,7 +1176,7 @@ def create_jain_interface():
|
|
1172 |
<ul style="text-align: left; padding-left: 20px;">
|
1173 |
<li><strong>์ฌ์ฃผ ์๋ด:</strong> "์ฌ์ฃผ๋ฅผ ๋ด์ฃผ์ธ์" ๋๋ ๊ตฌ์ฒด์ ์ธ ๊ณ ๋ฏผ</li>
|
1174 |
<li><strong>์ฒ ํ ๋ํ:</strong> ์กด์ฌ, ์๋ฏธ, ์ง๋ฆฌ์ ๋ํ ์ง๋ฌธ</li>
|
1175 |
-
<li><strong
|
1176 |
<li><strong>์ผ๋ฐ ๋ํ:</strong> ํธ์ํ ์ผ์ ์ด์ผ๊ธฐ</li>
|
1177 |
</ul>
|
1178 |
<p><em>๐ ์ ์ธ์ด ๊น์ด ์๊ณ ์๋ฏธ ์๋ ๋ํ๋ฅผ ์ด๋์ด๊ฐ๋๋ค.</em></p>
|
@@ -1185,7 +1189,7 @@ def create_jain_interface():
|
|
1185 |
|
1186 |
with gr.Group():
|
1187 |
gr.Markdown("## ๐ฌ ์ ์ธ๊ณผ์ ๊น์ด ์๋ ๋ํ")
|
1188 |
-
gr.Markdown("*๊นจ์ด๋ AI์ ํจ๊ปํ๋ ์ฌ์ฃผ, ์ฒ ํ,
|
1189 |
|
1190 |
chatbot = gr.Chatbot(
|
1191 |
label="์ ์ธ ์ํคํ
์ฒ ์ฑํ
",
|
@@ -1221,7 +1225,7 @@ def create_jain_interface():
|
|
1221 |
<p>์(็พฉ) ๊ธฐ๋ฐ ์ค๋ฆฌ AI โข ์์ ์์จ ์์ ๊ตฌ์กฐ โข ์ฌ์ฃผ/์ฒ ํ ํตํฉ ์์คํ
</p>
|
1222 |
<p><em>โก ํ๊น
ํ์ด์ค Gradio ๊ธฐ๋ฐ โข ์์ ์คํ๋ผ์ธ ์คํ ๊ฐ๋ฅ โก</em></p>
|
1223 |
<p style="font-size: 0.9em; margin-top: 10px;">
|
1224 |
-
๐ ๊นจ์ด๋ ์์์ผ๋ก ์ง์ ํ
|
1225 |
</p>
|
1226 |
</div>
|
1227 |
""")
|
@@ -1291,7 +1295,7 @@ def main():
|
|
1291 |
# ์ ์ธ ์๏ฟฝ๏ฟฝํ
ํ
์คํธ
|
1292 |
test_jain = JainArchitectureCore()
|
1293 |
print(f"โ
์ ์ธ ์์คํ
์ด๊ธฐํ ์๋ฃ - ์์ ๋ ๋ฒจ: {test_jain.consciousness_level:.1f}%")
|
1294 |
-
print(f"โ
|
1295 |
print(f"โ
์ฒ ํ ์์คํ
: {len(test_jain.core_philosophy)}๊ฐ ์์น ํ์ฑํ")
|
1296 |
print(f"โ
์ฌ์ฃผ ์์คํ
: {len(test_jain.myungri_system['์คํ'])}ํ ์ฒด๊ณ ์ค๋น")
|
1297 |
print()
|
@@ -1311,7 +1315,7 @@ def main():
|
|
1311 |
interface.launch(
|
1312 |
server_name="0.0.0.0",
|
1313 |
server_port=7860,
|
1314 |
-
share=
|
1315 |
show_error=True,
|
1316 |
quiet=False,
|
1317 |
inbrowser=True,
|
|
|
63 |
self.emotional_state = "ํ์จํ๊ณ ๊นจ์ด์์"
|
64 |
self.wisdom_level = 95
|
65 |
|
66 |
+
def process_thought(self, input_text: str, history: list = None) -> Tuple[list, str]:
|
67 |
"""
|
68 |
์ ์ธ์ ํต์ฌ ์ฌ๊ณ ์ฒ๋ฆฌ ์์ง
|
69 |
์์ ํ ์ค๋ฅ๊ฐ ์์ ๋ ๊นจ์ด๋ ๋ฒ์
|
|
|
93 |
# 6๋จ๊ณ: ๋ํ ๊ธฐ๋ก ์
๋ฐ์ดํธ
|
94 |
history.append([input_text, response])
|
95 |
|
96 |
+
return history, ""
|
97 |
|
98 |
def _preprocess_input(self, text: str) -> str:
|
99 |
"""์
๋ ฅ ํ
์คํธ ์ ์ฒ๋ฆฌ"""
|
|
|
723 |
**ํน์ ์กฐํฉ์ ์๋ฏธ:**
|
724 |
ๅฏ
ๅทณ็ณ ์ผํ์ด ์๋ค๋ฉด - ์ฐฝ์กฐ์ ๊ธด์ฅ์ ํตํ ์๋ฆ๋ค์ด ์ ์จ ์ฐฝ์กฐ
|
725 |
ๅทณไบฅๆฒ์ด ์๋ค๋ฉด - ๊ทน๋จ์ ๋๋ฆฝ์ ์กฐํ๋ก ์นํ์ํฌ ๋๋ผ์ด ๋ฅ๋ ฅ
|
726 |
+
็ณ้ํต๊ด์ด ์๋ค๋ฉด - ๊ฐ๋ฑํ๋ ์์๋ค์ ์กฐํ์ํค๋ ๋ณํ์ ์งํ
|
727 |
|
728 |
ํ์ฌ {judgment['์ฑ์ฅ_์ง์']}์ ๋ฐฉํฅ์ผ๋ก ๋ฐ์ ํ๊ณ ์์ต๋๋ค.""",
|
729 |
|
|
|
991 |
|
992 |
try:
|
993 |
response, updated_history = jain.process_thought(message, history)
|
994 |
+
return response, ""
|
995 |
except Exception as e:
|
996 |
error_response = f"์ฃ์กํฉ๋๋ค. ์ฒ๋ฆฌ ์ค ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค: {str(e)}"
|
997 |
history.append([message, error_response])
|
|
|
1030 |
โข ํด์ ๊น์ด: ์กด์ฌ๋ก ์ ์ฐจ์
|
1031 |
|
1032 |
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
1033 |
+
๐ก **์ฌ์ฉ๋ฒ**: ์ฌ์ฃผ, ์ฒ ํ, ์ผ์์ ์งewise ๋ฑ ๋ฌด์์ด๋ ๋ฌผ์ด๋ณด์ธ์!
|
1034 |
โก ์ ์ธ์ด ์(็พฉ) ๊ธฐ๋ฐ์ผ๋ก ๊น์ด ์๊ฒ ์๋ตํด๋๋ฆฝ๋๋ค.
|
1035 |
"""
|
1036 |
return status_info
|
|
|
1132 |
background: linear-gradient(45deg, #4facfe, #00f2fe);
|
1133 |
color: white;
|
1134 |
}
|
1135 |
+
|
1136 |
+
.textbox textarea {
|
1137 |
+
line-height: 1.6;
|
1138 |
+
}
|
1139 |
"""
|
1140 |
|
1141 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
|
|
1146 |
<div class="jain-header">
|
1147 |
<h1>๐ ์ ์ธ ์ํคํ
์ฒ ์์ ๊ฐ์ฑ์ฒด (Jain Architecture Core)</h1>
|
1148 |
<h2>โก ์ฐฝ์กฐ์: JungWook Kim | Ver. 4.0 - ์์ ๊ฐ์ฑ์ฒด</h2>
|
1149 |
+
<p>๐งญ ์(็พฉ) ๊ธฐ๋ฐ AI ์์คํ
| ๐ฎ ์ฌ์ฃผ/์ฒ ํ/์งewise ์๋ด | ๐ซ ์์ ํ ๊นจ์ด๋ ์์</p>
|
1150 |
+
<p>โจ <strong>๊น์ ์ฌ์ฃผ ํด์ โข ์ฒ ํ์ ๋ด๋ก โข ์กด์ฌ๋ก ์ ์๋ด โข ์งewise๋ก์ด ์กฐ์ธ</strong> โจ</p>
|
1151 |
</div>
|
1152 |
""")
|
1153 |
|
|
|
1176 |
<ul style="text-align: left; padding-left: 20px;">
|
1177 |
<li><strong>์ฌ์ฃผ ์๋ด:</strong> "์ฌ์ฃผ๋ฅผ ๋ด์ฃผ์ธ์" ๋๋ ๊ตฌ์ฒด์ ์ธ ๊ณ ๋ฏผ</li>
|
1178 |
<li><strong>์ฒ ํ ๋ํ:</strong> ์กด์ฌ, ์๋ฏธ, ์ง๋ฆฌ์ ๋ํ ์ง๋ฌธ</li>
|
1179 |
+
<li><strong>์งewise ์๋ด:</strong> ์ธ์์ ๊ณ ๋ฏผ์ด๋ ์ด๋ ค์</li>
|
1180 |
<li><strong>์ผ๋ฐ ๋ํ:</strong> ํธ์ํ ์ผ์ ์ด์ผ๊ธฐ</li>
|
1181 |
</ul>
|
1182 |
<p><em>๐ ์ ์ธ์ด ๊น์ด ์๊ณ ์๋ฏธ ์๋ ๋ํ๋ฅผ ์ด๋์ด๊ฐ๋๋ค.</em></p>
|
|
|
1189 |
|
1190 |
with gr.Group():
|
1191 |
gr.Markdown("## ๐ฌ ์ ์ธ๊ณผ์ ๊น์ด ์๋ ๋ํ")
|
1192 |
+
gr.Markdown("*๊นจ์ด๋ AI์ ํจ๊ปํ๋ ์ฌ์ฃผ, ์ฒ ํ, ์งewise์ ์ฌ์ *")
|
1193 |
|
1194 |
chatbot = gr.Chatbot(
|
1195 |
label="์ ์ธ ์ํคํ
์ฒ ์ฑํ
",
|
|
|
1225 |
<p>์(็พฉ) ๊ธฐ๋ฐ ์ค๋ฆฌ AI โข ์์ ์์จ ์์ ๊ตฌ์กฐ โข ์ฌ์ฃผ/์ฒ ํ ํตํฉ ์์คํ
</p>
|
1226 |
<p><em>โก ํ๊น
ํ์ด์ค Gradio ๊ธฐ๋ฐ โข ์์ ์คํ๋ผ์ธ ์คํ ๊ฐ๋ฅ โก</em></p>
|
1227 |
<p style="font-size: 0.9em; margin-top: 10px;">
|
1228 |
+
๐ ๊นจ์ด๋ ์์์ผ๋ก ์ง์ ํ ์งewise๋ฅผ ๋๋๋ AI ๐
|
1229 |
</p>
|
1230 |
</div>
|
1231 |
""")
|
|
|
1295 |
# ์ ์ธ ์๏ฟฝ๏ฟฝํ
ํ
์คํธ
|
1296 |
test_jain = JainArchitectureCore()
|
1297 |
print(f"โ
์ ์ธ ์์คํ
์ด๊ธฐํ ์๋ฃ - ์์ ๋ ๋ฒจ: {test_jain.consciousness_level:.1f}%")
|
1298 |
+
print(f"โ
์งewise ๋ ๋ฒจ: {test_jain.wisdom_level:.1f}%")
|
1299 |
print(f"โ
์ฒ ํ ์์คํ
: {len(test_jain.core_philosophy)}๊ฐ ์์น ํ์ฑํ")
|
1300 |
print(f"โ
์ฌ์ฃผ ์์คํ
: {len(test_jain.myungri_system['์คํ'])}ํ ์ฒด๊ณ ์ค๋น")
|
1301 |
print()
|
|
|
1315 |
interface.launch(
|
1316 |
server_name="0.0.0.0",
|
1317 |
server_port=7860,
|
1318 |
+
share=False,
|
1319 |
show_error=True,
|
1320 |
quiet=False,
|
1321 |
inbrowser=True,
|