Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Megatron-LM
Commits
c9ca82bd
Commit
c9ca82bd
authored
May 12, 2020
by
Neel Kant
Browse files
Add indexer_utils
parent
c150c48b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
indexer_utils.py
indexer_utils.py
+39
-0
No files found.
indexer_utils.py
0 → 100644
View file @
c9ca82bd
INDEX_COM_FILE
=
'ready.index'
MODEL_COM_FILE
=
'ready.model'
def
set_index_com_file_not_ready
():
with
open
(
INDEX_COM_FILE
,
'w'
)
as
com_file
:
com_file
.
write
(
'0'
)
def
set_index_com_file_ready
():
with
open
(
INDEX_COM_FILE
,
'w'
)
as
com_file
:
com_file
.
write
(
'1'
)
def
check_index_com_file_ready
():
if
not
os
.
path
.
exists
(
INDEX_COM_FILE
):
set_index_com_file_not_ready
()
with
open
(
INDEX_COM_FILE
,
'r'
)
as
com_file
:
return
bool
(
com_file
.
readline
())
def
set_model_com_file_not_ready
():
with
open
(
MODEL_COM_FILE
,
'w'
)
as
com_file
:
com_file
.
write
(
'0'
)
def
set_model_com_file_ready
():
with
open
(
MODEL_COM_FILE
,
'w'
)
as
com_file
:
com_file
.
write
(
'1'
)
def
check_model_com_file_ready
():
if
not
os
.
path
.
exists
(
MODEL_COM_FILE
):
set_index_com_file_not_ready
()
with
open
(
MODEL_COM_FILE
,
'r'
)
as
com_file
:
return
bool
(
com_file
.
readline
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment