Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,16 +4,6 @@ from huggingface_hub import InferenceClient
|
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
import chatglm_cpp
|
6 |
|
7 |
-
def list_files_tree(directory, indent=""):
|
8 |
-
items = os.listdir(directory)
|
9 |
-
for i, item in enumerate(items):
|
10 |
-
prefix = "βββ " if i == len(items) - 1 else "βββ "
|
11 |
-
print(indent + prefix + item)
|
12 |
-
item_path = os.path.join(directory, item)
|
13 |
-
if os.path.isdir(item_path):
|
14 |
-
next_indent = indent + (" " if i == len(items) - 1 else "β ")
|
15 |
-
list_files_tree(item_path, next_indent)
|
16 |
-
|
17 |
pipeline = None
|
18 |
|
19 |
def load(repo_id, filename):
|
@@ -43,7 +33,7 @@ def respond(
|
|
43 |
return
|
44 |
|
45 |
response = ""
|
46 |
-
yield
|
47 |
|
48 |
generation_kwargs = dict(
|
49 |
max_length=8192,
|
@@ -72,8 +62,7 @@ with gr.Blocks() as chat:
|
|
72 |
repo_id_input = gr.Textbox(label="Repo ID", value="None1145/ChatGLM3-6B-Theresa-GGML")
|
73 |
filename_input = gr.Textbox(label="Filename", value="ChatGLM3-6B-Theresa-GGML-Q4_0.bin")
|
74 |
load_button = gr.Button("Load Model")
|
75 |
-
|
76 |
-
load_status = gr.Textbox(label="Load Status", interactive=False)
|
77 |
load_button.click(load, inputs=[repo_id_input, filename_input], outputs=load_status)
|
78 |
|
79 |
chat_interface = gr.ChatInterface(
|
|
|
4 |
from huggingface_hub import hf_hub_download
|
5 |
import chatglm_cpp
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
pipeline = None
|
8 |
|
9 |
def load(repo_id, filename):
|
|
|
33 |
return
|
34 |
|
35 |
response = ""
|
36 |
+
yield " "
|
37 |
|
38 |
generation_kwargs = dict(
|
39 |
max_length=8192,
|
|
|
62 |
repo_id_input = gr.Textbox(label="Repo ID", value="None1145/ChatGLM3-6B-Theresa-GGML")
|
63 |
filename_input = gr.Textbox(label="Filename", value="ChatGLM3-6B-Theresa-GGML-Q4_0.bin")
|
64 |
load_button = gr.Button("Load Model")
|
65 |
+
load_status = gr.Textbox(label="Load Status", interactive=False)
|
|
|
66 |
load_button.click(load, inputs=[repo_id_input, filename_input], outputs=load_status)
|
67 |
|
68 |
chat_interface = gr.ChatInterface(
|