Spaces:
Sleeping
Sleeping
seawolf2357
commited on
Commit
•
a8a69ff
1
Parent(s):
c83e206
Update app.py
Browse files
app.py
CHANGED
@@ -102,10 +102,12 @@ async def generate_response(message):
|
|
102 |
|
103 |
def search_in_dataset(query, dataset):
|
104 |
for record in dataset['train']:
|
105 |
-
|
|
|
106 |
return record['사건번호']
|
107 |
return "관련 법률 정보를 찾을 수 없습니다."
|
108 |
|
|
|
109 |
if __name__ == "__main__":
|
110 |
discord_client = MyClient(intents=intents)
|
111 |
discord_client.run(os.getenv('DISCORD_TOKEN'))
|
|
|
102 |
|
103 |
def search_in_dataset(query, dataset):
|
104 |
for record in dataset['train']:
|
105 |
+
# '사건명'이 None이 아닌지 확인하고, query가 해당 값에 포함되어 있는지 검사
|
106 |
+
if record['사건명'] and query in record['사건명']:
|
107 |
return record['사건번호']
|
108 |
return "관련 법률 정보를 찾을 수 없습니다."
|
109 |
|
110 |
+
|
111 |
if __name__ == "__main__":
|
112 |
discord_client = MyClient(intents=intents)
|
113 |
discord_client.run(os.getenv('DISCORD_TOKEN'))
|