CoolFace
Apppublic

es2103/mkdjd

sourceHugging Faceupdated 4d agoView on Hugging Face
0likes
app.py38 linesDownload Raw Back to root
1import gradio as gr2import spaces3from huggingface_hub import hf_hub_download4from llama_cpp import Llama5 6REPO_ID = "es_2103/qwen"  # или полный ID репозитория7FILENAME = "Qwen3.6-35B-A3B-BUDGET-13.5GiB-QAT (1).gguf"8 9llm = None10 11def load_model():12    global llm13    if llm is None:14        model_path = hf_hub_download(repo_id=REPO_ID, filename=FILENAME)15        llm = Llama(16            model_path=model_path,17            n_ctx=65536,18            n_gpu_layers=-1,19            n_cpu_moe=14,20            flash_attn=True,21            type_k=8,22            type_v=8,23            verbose=False24        )25    return llm26 27@spaces.GPU(duration=180)28def generate_response(message, history):29    model = load_model()30    response = model.create_chat_completion(31        messages=[{"role": "user", "content": message}],32        temperature=0.3,33        max_tokens=51234    )35    return response["choices"][0]["message"]["content"]36 37demo = gr.ChatInterface(fn=generate_response, title="Qwen3.6-35B-A3B BUDGET")38demo.launch()