Instructions to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Qwen/Qwen2.5-0.5B-Instruct-GGUF", filename="qwen2.5-0.5b-instruct-fp16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
Use Docker
docker model run hf.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Qwen/Qwen2.5-0.5B-Instruct-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Qwen/Qwen2.5-0.5B-Instruct-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
- Ollama
How to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with Ollama:
ollama run hf.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
- Unsloth Studio
How to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Qwen/Qwen2.5-0.5B-Instruct-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Qwen/Qwen2.5-0.5B-Instruct-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Qwen/Qwen2.5-0.5B-Instruct-GGUF to start chatting
- Pi
How to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with Docker Model Runner:
docker model run hf.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
- Lemonade
How to use Qwen/Qwen2.5-0.5B-Instruct-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Qwen/Qwen2.5-0.5B-Instruct-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Qwen2.5-0.5B-Instruct-GGUF-Q4_K_M
List all available models
lemonade list
Create app.py
#5
by Seriki - opened
app.py
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
+
import requests
|
| 4 |
+
|
| 5 |
+
# Configuration for both endpoints
|
| 6 |
+
TRANSCRIPTION_ENDPOINT = "https://your-whisper-endpoint.endpoints.huggingface.cloud/api/v1/audio/transcriptions"
|
| 7 |
+
SUMMARIZATION_ENDPOINT = "https://your-qwen-endpoint.endpoints.huggingface.cloud/v1/chat/completions"
|
| 8 |
+
HF_TOKEN = os.getenv("HF_TOKEN") # Your Hugging Face Hub token
|
| 9 |
+
|
| 10 |
+
# Headers for authentication
|
| 11 |
+
headers = {
|
| 12 |
+
"Authorization": f"Bearer {HF_TOKEN}"
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
+
def transcribe_audio(audio_file_path):
|
| 16 |
+
"""Transcribe audio using direct requests to the endpoint"""
|
| 17 |
+
|
| 18 |
+
# Read audio file and prepare for upload
|
| 19 |
+
with open(audio_file_path, "rb") as audio_file:
|
| 20 |
+
files = {"file": audio_file.read()}
|
| 21 |
+
|
| 22 |
+
# Make the request to the transcription endpoint
|
| 23 |
+
response = requests.post(TRANSCRIPTION_ENDPOINT, headers=headers, files=files)
|
| 24 |
+
|
| 25 |
+
if response.status_code == 200:
|
| 26 |
+
result = response.json()
|
| 27 |
+
return result.get("text", "No transcription available")
|
| 28 |
+
else:
|
| 29 |
+
return f"Error: {response.status_code} - {response.text}"
|
| 30 |
+
|
| 31 |
+
def generate_summary(transcript):
|
| 32 |
+
"""Generate summary using requests to the chat completions endpoint"""
|
| 33 |
+
|
| 34 |
+
prompt = f"""
|
| 35 |
+
Analyze this meeting transcript and provide:
|
| 36 |
+
1. A concise summary of key points
|
| 37 |
+
2. Action items with responsible parties
|
| 38 |
+
3. Important decisions made
|
| 39 |
+
|
| 40 |
+
Transcript: {transcript}
|
| 41 |
+
|
| 42 |
+
Format with clear sections:
|
| 43 |
+
## Summary
|
| 44 |
+
## Action Items
|
| 45 |
+
## Decisions Made
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
+
# Prepare the payload using the Messages API format
|
| 49 |
+
payload = {
|
| 50 |
+
"model": "your-qwen-endpoint-name", # Use the name of your endpoint
|
| 51 |
+
"messages": [{"role": "user", "content": prompt}],
|
| 52 |
+
"max_tokens": 1000,
|
| 53 |
+
"temperature": 0.7,
|
| 54 |
+
"stream": False
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
# Headers for chat completions
|
| 58 |
+
chat_headers = {
|
| 59 |
+
"Accept": "application/json",
|
| 60 |
+
"Content-Type": "application/json",
|
| 61 |
+
"Authorization": f"Bearer {HF_TOKEN}"
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
# Make the request
|
| 65 |
+
response = requests.post(SUMMARIZATION_ENDPOINT, headers=chat_headers, json=payload)
|
| 66 |
+
response.raise_for_status()
|
| 67 |
+
|
| 68 |
+
# Parse the response
|
| 69 |
+
result = response.json()
|
| 70 |
+
return result["choices"][0]["message"]["content"]
|
| 71 |
+
|
| 72 |
+
def process_meeting_audio(audio_file):
|
| 73 |
+
"""Main processing function that handles the complete workflow"""
|
| 74 |
+
if audio_file is None:
|
| 75 |
+
return "Please upload an audio file.", ""
|
| 76 |
+
|
| 77 |
+
try:
|
| 78 |
+
# Step 1: Transcribe the audio
|
| 79 |
+
transcript = transcribe_audio(audio_file)
|
| 80 |
+
|
| 81 |
+
# Step 2: Generate summary from transcript
|
| 82 |
+
summary = generate_summary(transcript)
|
| 83 |
+
|
| 84 |
+
return transcript, summary
|
| 85 |
+
|
| 86 |
+
except Exception as e:
|
| 87 |
+
return f"Error processing audio: {str(e)}", ""
|
| 88 |
+
|
| 89 |
+
# Create Gradio interface
|
| 90 |
+
app = gr.Interface(
|
| 91 |
+
fn=process_meeting_audio,
|
| 92 |
+
inputs=gr.Audio(label="Upload Meeting Audio", type="filepath"),
|
| 93 |
+
outputs=[
|
| 94 |
+
gr.Textbox(label="Full Transcript", lines=10),
|
| 95 |
+
gr.Textbox(label="Meeting Summary", lines=8),
|
| 96 |
+
],
|
| 97 |
+
title="🎤 AI Meeting Notes",
|
| 98 |
+
description="Upload audio to get instant transcripts and summaries.",
|
| 99 |
+
)
|
| 100 |
+
|
| 101 |
+
if __name__ == "__main__":
|
| 102 |
+
app.launch()
|