Spaces:
Runtime error
Runtime error
jerome-white
commited on
Commit
•
4787644
1
Parent(s):
fd75053
Handle missing assistants
Browse files
tools/resource-cleanup.py
CHANGED
@@ -4,7 +4,7 @@ from pathlib import Path
|
|
4 |
from argparse import ArgumentParser
|
5 |
|
6 |
from scipy import constants
|
7 |
-
from openai import OpenAI
|
8 |
|
9 |
from mylib import Logger, VectorStoreManager
|
10 |
|
@@ -67,4 +67,7 @@ if __name__ == '__main__':
|
|
67 |
remove.append(a.id)
|
68 |
|
69 |
for a in remove:
|
70 |
-
|
|
|
|
|
|
|
|
4 |
from argparse import ArgumentParser
|
5 |
|
6 |
from scipy import constants
|
7 |
+
from openai import OpenAI, NotFoundError
|
8 |
|
9 |
from mylib import Logger, VectorStoreManager
|
10 |
|
|
|
67 |
remove.append(a.id)
|
68 |
|
69 |
for a in remove:
|
70 |
+
try:
|
71 |
+
client.beta.assistants.delete(a)
|
72 |
+
except NotFoundError:
|
73 |
+
Logger.error(a)
|