代码里面用到的模型文件可以在我的网盘链接下载,如果没有找到,可以联系我
#coding:utf-8
# pyinstaller -F qwen-chat-demo.py
# pyarmor obfuscate qwen-chat-demo.py
# pyarmor gen qwen-chat-demo.py
# use NKSR public env
# pip install -U numpy -i https://pypi.tuna.tsinghua.edu.cn/simple/
# pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple/
# pip install llama-cpp-python -i https://pypi.tuna.tsinghua.edu.cn/simple/
# $env:CMAKE_ARGS = "-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS"
# CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python
#!/usr/bin/python3
import tkinter as tk
import tkinter.ttk as ttk
from llama_cpp import Llama
llm = Llama(model_path=r"