CineAI commited on
Commit
58abf09
·
verified ·
1 Parent(s): 96e2394

Update llm/huggingfacehub/hf_model.py

Browse files
Files changed (1) hide show
  1. llm/huggingfacehub/hf_model.py +11 -7
llm/huggingfacehub/hf_model.py CHANGED
@@ -26,12 +26,16 @@ logger.addHandler(file_handler)
26
 
27
  logger.info("Getting information from hf_model module")
28
 
29
- try:
30
- os.chdir('/home/user/app/llm/')
31
- except FileNotFoundError:
32
- print("Error: Could not move up. You might be at the root directory.")
33
 
34
- work_dir = os.getcwd()
 
 
 
 
35
 
36
 
37
  class HF_Mistaril(HFInterface, ABC):
@@ -53,7 +57,7 @@ class HF_Mistaril(HFInterface, ABC):
53
  @staticmethod
54
  def __read_yaml():
55
  try:
56
- yaml_file = os.path.join(work_dir, 'prompts.yaml')
57
  with open(yaml_file, 'r') as f:
58
  data = yaml.safe_load(f)
59
  f.close()
@@ -101,7 +105,7 @@ class HF_TinyLlama(HFInterface, ABC):
101
  @staticmethod
102
  def __read_yaml():
103
  try:
104
- yaml_file = os.path.join(work_dir, 'prompts.yaml')
105
  with open(yaml_file, 'r') as f:
106
  data = yaml.safe_load(f)
107
  f.close()
 
26
 
27
  logger.info("Getting information from hf_model module")
28
 
29
+ # try:
30
+ # os.chdir('/home/user/app/llm/')
31
+ # except FileNotFoundError:
32
+ # print("Error: Could not move up. You might be at the root directory.")
33
 
34
+ # work_dir = os.getcwd()
35
+
36
+ print("CWD : ", os.getcwd())
37
+
38
+ llm_dir = '/home/user/app/llm/'
39
 
40
 
41
  class HF_Mistaril(HFInterface, ABC):
 
57
  @staticmethod
58
  def __read_yaml():
59
  try:
60
+ yaml_file = os.path.join(llm_dir, 'prompts.yaml')
61
  with open(yaml_file, 'r') as f:
62
  data = yaml.safe_load(f)
63
  f.close()
 
105
  @staticmethod
106
  def __read_yaml():
107
  try:
108
+ yaml_file = os.path.join(llm_dir, 'prompts.yaml')
109
  with open(yaml_file, 'r') as f:
110
  data = yaml.safe_load(f)
111
  f.close()