Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
#MODEL_ID = "ibm-granite/granite-3.1-2b-instruct"
|
2 |
MODEL_ID = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
3 |
-
|
4 |
|
5 |
import subprocess
|
6 |
def run_command(command, cwd=None):
|
@@ -39,9 +39,9 @@ def setup_model(model_id):
|
|
39 |
gguf_path = f"{local_dir}.gguf"
|
40 |
if not os.path.exists(gguf_path):
|
41 |
run_command(f'python llama.cpp/convert_hf_to_gguf.py ./{local_dir} --outfile {gguf_path}')
|
42 |
-
quantized_path = f"{local_dir}-
|
43 |
if not os.path.exists(quantized_path):
|
44 |
-
run_command(f'./llama.cpp/build/bin/llama-quantize ./{gguf_path} {quantized_path}
|
45 |
return quantized_path
|
46 |
|
47 |
def chat_with_model(message, history, system_prompt, temperature, max_tokens, top_k, top_p):
|
|
|
1 |
#MODEL_ID = "ibm-granite/granite-3.1-2b-instruct"
|
2 |
MODEL_ID = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
|
3 |
+
QUANT = "Q5_K_M"
|
4 |
|
5 |
import subprocess
|
6 |
def run_command(command, cwd=None):
|
|
|
39 |
gguf_path = f"{local_dir}.gguf"
|
40 |
if not os.path.exists(gguf_path):
|
41 |
run_command(f'python llama.cpp/convert_hf_to_gguf.py ./{local_dir} --outfile {gguf_path}')
|
42 |
+
quantized_path = f"{local_dir}-{QUANT}.gguf"
|
43 |
if not os.path.exists(quantized_path):
|
44 |
+
run_command(f'./llama.cpp/build/bin/llama-quantize ./{gguf_path} {quantized_path} {QUANT}')
|
45 |
return quantized_path
|
46 |
|
47 |
def chat_with_model(message, history, system_prompt, temperature, max_tokens, top_k, top_p):
|