npc0 commited on
Commit
e835725
1 Parent(s): aa4225d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -2,10 +2,11 @@ import os
2
  import gradio as gr
3
  from epub2txt import epub2txt
4
 
5
- os.system("git clone --recurse-submodules https://github.com/ztxz16/fastllm.git")
6
- os.system("cd fastllm; mkdir build; cd build; cmake ..; make -j; cd tools; python setup.py install")
7
- os.system("wget https://huggingface.co/huangyuyang/chatglm2-6b-int4.flm/resolve/main/chatglm2-6b-int4.flm")
8
-
 
9
  from fastllm_pytools import llm
10
  model = llm.model("./chatglm2-6b-int4.flm")
11
  prompt = os.getenv("prompt")
 
2
  import gradio as gr
3
  from epub2txt import epub2txt
4
 
5
+ if not os.path.exists("./chatglm2-6b-int4.flm"):
6
+ os.system("git clone --recurse-submodules https://github.com/ztxz16/fastllm.git")
7
+ os.system("cd fastllm; mkdir build; cd build; cmake ..; make -j; cd tools; sudo python setup.py install")
8
+ # os.system("wget https://huggingface.co/huangyuyang/chatglm2-6b-int4.flm/resolve/main/chatglm2-6b-int4.flm")
9
+
10
  from fastllm_pytools import llm
11
  model = llm.model("./chatglm2-6b-int4.flm")
12
  prompt = os.getenv("prompt")