Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,4 @@
|
|
1 |
-
import gradio as gr
|
2 |
import subprocess
|
3 |
-
import os
|
4 |
-
from llama_cpp import Llama
|
5 |
-
from huggingface_hub import snapshot_download
|
6 |
-
|
7 |
def run_command(command, cwd=None):
|
8 |
"""运行系统命令"""
|
9 |
result = subprocess.run(command, shell=True, cwd=cwd, text=True, capture_output=True)
|
@@ -15,9 +10,17 @@ def run_command(command, cwd=None):
|
|
15 |
print(f"命令执行成功: {command}")
|
16 |
print(result.stdout)
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
def setup_llama_cpp():
|
19 |
"""克隆并编译llama.cpp仓库"""
|
20 |
-
run_command('pip install llama-cpp-python')
|
21 |
if not os.path.exists('llama.cpp'):
|
22 |
run_command('git clone https://github.com/ggml-org/llama.cpp.git')
|
23 |
os.chdir('llama.cpp')
|
|
|
|
|
1 |
import subprocess
|
|
|
|
|
|
|
|
|
2 |
def run_command(command, cwd=None):
|
3 |
"""运行系统命令"""
|
4 |
result = subprocess.run(command, shell=True, cwd=cwd, text=True, capture_output=True)
|
|
|
10 |
print(f"命令执行成功: {command}")
|
11 |
print(result.stdout)
|
12 |
|
13 |
+
|
14 |
+
run_command('pip install llama-cpp-python')
|
15 |
+
|
16 |
+
import gradio as gr
|
17 |
+
import os
|
18 |
+
from llama_cpp import Llama
|
19 |
+
from huggingface_hub import snapshot_download
|
20 |
+
|
21 |
+
|
22 |
def setup_llama_cpp():
|
23 |
"""克隆并编译llama.cpp仓库"""
|
|
|
24 |
if not os.path.exists('llama.cpp'):
|
25 |
run_command('git clone https://github.com/ggml-org/llama.cpp.git')
|
26 |
os.chdir('llama.cpp')
|