Update llm/llamacpp/lc_model.py
Browse files- llm/llamacpp/lc_model.py +2 -4
llm/llamacpp/lc_model.py
CHANGED
@@ -38,14 +38,13 @@ class LC_TinyLlama(LLMInterface, ABC):
|
|
38 |
with open(path_to_model, "wb") as f:
|
39 |
f.write(get_file.content)
|
40 |
logger.info("Model file successfully recorded")
|
|
|
41 |
except FileExistsError:
|
42 |
print(f"Model file {path_to_model} already exists. Skipping download.")
|
43 |
logger.info(f"Model file {path_to_model} already exists. Skipping download.")
|
44 |
except OSError as e:
|
45 |
print(f"Error while writing a file to directory : {e}")
|
46 |
logger.error(msg="Error while write a file to directory", exc_info=e)
|
47 |
-
finally:
|
48 |
-
f.close()
|
49 |
|
50 |
@staticmethod
|
51 |
def __read_yaml():
|
@@ -132,13 +131,12 @@ class LC_Phi3(LLMInterface, ABC):
|
|
132 |
with open(path_to_model, "wb") as f:
|
133 |
f.write(get_file.content)
|
134 |
logger.info("Model file successfully recorded")
|
|
|
135 |
except FileExistsError:
|
136 |
logger.info(f"Model file {path_to_model} already exists. Skipping download.")
|
137 |
except OSError as e:
|
138 |
print(f"Error while writing a file to directory : {e}")
|
139 |
logger.error(msg="Error while write a file to directory", exc_info=e)
|
140 |
-
finally:
|
141 |
-
f.close()
|
142 |
|
143 |
@staticmethod
|
144 |
def __read_yaml():
|
|
|
38 |
with open(path_to_model, "wb") as f:
|
39 |
f.write(get_file.content)
|
40 |
logger.info("Model file successfully recorded")
|
41 |
+
f.close()
|
42 |
except FileExistsError:
|
43 |
print(f"Model file {path_to_model} already exists. Skipping download.")
|
44 |
logger.info(f"Model file {path_to_model} already exists. Skipping download.")
|
45 |
except OSError as e:
|
46 |
print(f"Error while writing a file to directory : {e}")
|
47 |
logger.error(msg="Error while write a file to directory", exc_info=e)
|
|
|
|
|
48 |
|
49 |
@staticmethod
|
50 |
def __read_yaml():
|
|
|
131 |
with open(path_to_model, "wb") as f:
|
132 |
f.write(get_file.content)
|
133 |
logger.info("Model file successfully recorded")
|
134 |
+
f.close()
|
135 |
except FileExistsError:
|
136 |
logger.info(f"Model file {path_to_model} already exists. Skipping download.")
|
137 |
except OSError as e:
|
138 |
print(f"Error while writing a file to directory : {e}")
|
139 |
logger.error(msg="Error while write a file to directory", exc_info=e)
|
|
|
|
|
140 |
|
141 |
@staticmethod
|
142 |
def __read_yaml():
|