Limour commited on
Commit
d1f917c
·
verified ·
1 Parent(s): 556fcdd

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -42,10 +42,10 @@ custom_css = r'''
42
  }
43
  '''
44
 
45
-
46
  # ========== 存储的路径 ==========
47
  print('HF_HOME', os.getenv("HF_HOME"))
48
 
 
49
  # ========== 适配 SillyTavern 的模版 ==========
50
  def text_format(text: str, _env=None, **env):
51
  if _env is not None:
@@ -111,6 +111,17 @@ with gr.Blocks() as setting:
111
  print(f"The file {setting_path.value} exists.")
112
  else:
113
  from huggingface_hub import snapshot_download
 
 
 
 
 
 
 
 
 
 
 
114
  os.mkdir("downloads")
115
  os.mkdir("cache")
116
  tmp = snapshot_download(repo_id='TheBloke/CausalLM-7B-GGUF', allow_patterns='causallm_7b.Q5_K_M.gguf')
 
42
  }
43
  '''
44
 
 
45
  # ========== 存储的路径 ==========
46
  print('HF_HOME', os.getenv("HF_HOME"))
47
 
48
+
49
  # ========== 适配 SillyTavern 的模版 ==========
50
  def text_format(text: str, _env=None, **env):
51
  if _env is not None:
 
111
  print(f"The file {setting_path.value} exists.")
112
  else:
113
  from huggingface_hub import snapshot_download
114
+
115
+
116
+ def hf_test():
117
+ directory = "/data/.huggingface/models/TheBloke/CausalLM-7B-GGUF"
118
+ # 遍历目录下的所有文件
119
+ for root, dirs, files in os.walk(directory):
120
+ for file in files:
121
+ print(os.path.join(root, file))
122
+
123
+
124
+ hf_test()
125
  os.mkdir("downloads")
126
  os.mkdir("cache")
127
  tmp = snapshot_download(repo_id='TheBloke/CausalLM-7B-GGUF', allow_patterns='causallm_7b.Q5_K_M.gguf')