Spaces:
Sleeping
Sleeping
Commit
·
73b392d
1
Parent(s):
66b30db
check if v2 to v1 already done
Browse files
app.py
CHANGED
|
@@ -20,15 +20,11 @@ def replace_string_in_files(folder_path, old_str, new_str):
|
|
| 20 |
# Replace the old string with the new string
|
| 21 |
print(line.replace(old_str, new_str), end='')
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
#if status[-1] != 'changed':
|
| 27 |
-
#replace_string_in_files(module_file_path, 'from pydantic', 'from pydantic.v1')
|
| 28 |
-
# with open('change_log.txt','w'):
|
| 29 |
-
# f.write('changed')
|
| 30 |
-
|
| 31 |
|
|
|
|
|
|
|
| 32 |
|
| 33 |
|
| 34 |
from operator import index
|
|
|
|
| 20 |
# Replace the old string with the new string
|
| 21 |
print(line.replace(old_str, new_str), end='')
|
| 22 |
|
| 23 |
+
with open(module_file_path+'/schema.py','r') as f:
|
| 24 |
+
haystack_schema_file = f.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
if 'from pydantic.v1' not in haystack_schema_file:
|
| 27 |
+
replace_string_in_files(module_file_path, 'from pydantic', 'from pydantic.v1')
|
| 28 |
|
| 29 |
|
| 30 |
from operator import index
|