Instructions to use ValleHorn/german-audio-correction-gemma2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ValleHorn/german-audio-correction-gemma2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ValleHorn/german-audio-correction-gemma2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ValleHorn/german-audio-correction-gemma2") model = AutoModelForCausalLM.from_pretrained("ValleHorn/german-audio-correction-gemma2") - llama-cpp-python
How to use ValleHorn/german-audio-correction-gemma2 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="ValleHorn/german-audio-correction-gemma2", filename="gemma-2-2b-it.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use ValleHorn/german-audio-correction-gemma2 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ValleHorn/german-audio-correction-gemma2:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ValleHorn/german-audio-correction-gemma2:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf ValleHorn/german-audio-correction-gemma2:Q4_K_M # Run inference directly in the terminal: llama-cli -hf ValleHorn/german-audio-correction-gemma2: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 ValleHorn/german-audio-correction-gemma2:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ValleHorn/german-audio-correction-gemma2: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 ValleHorn/german-audio-correction-gemma2:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ValleHorn/german-audio-correction-gemma2:Q4_K_M
Use Docker
docker model run hf.co/ValleHorn/german-audio-correction-gemma2:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ValleHorn/german-audio-correction-gemma2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ValleHorn/german-audio-correction-gemma2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ValleHorn/german-audio-correction-gemma2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ValleHorn/german-audio-correction-gemma2:Q4_K_M
- SGLang
How to use ValleHorn/german-audio-correction-gemma2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ValleHorn/german-audio-correction-gemma2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ValleHorn/german-audio-correction-gemma2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ValleHorn/german-audio-correction-gemma2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ValleHorn/german-audio-correction-gemma2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use ValleHorn/german-audio-correction-gemma2 with Ollama:
ollama run hf.co/ValleHorn/german-audio-correction-gemma2:Q4_K_M
- Unsloth Studio new
How to use ValleHorn/german-audio-correction-gemma2 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 ValleHorn/german-audio-correction-gemma2 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 ValleHorn/german-audio-correction-gemma2 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ValleHorn/german-audio-correction-gemma2 to start chatting
- Docker Model Runner
How to use ValleHorn/german-audio-correction-gemma2 with Docker Model Runner:
docker model run hf.co/ValleHorn/german-audio-correction-gemma2:Q4_K_M
- Lemonade
How to use ValleHorn/german-audio-correction-gemma2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ValleHorn/german-audio-correction-gemma2:Q4_K_M
Run and chat with the model
lemonade run user.german-audio-correction-gemma2-Q4_K_M
List all available models
lemonade list
Model Card for Model ID
license: apache-2.0 base_model: unsloth/gemma-2-2b-it tags: - fine-tuned - text-correction - german - asr-postprocessing - gguf - unsloth - lora
German Audio Correction - Gemma-2-2B-IT Fine-Tune
Overview
This model is a fine-tuned version of unsloth/gemma-2-2b-it, specialized for correcting German text from audio transcriptions (STT/ASR outputs). It fixes phonetic errors (e.g., misheard words), awkward sentence structures, repetitions (e.g., "die die"), and punctuation issues while preserving the original meaning. Designed for chaining after an STT model like Whisper, it helps create clean, readable German text for applications like note-taking or web apps.
Background: Proprietary APIs (e.g., OpenAI) offer quick inference but limit control. This open-source fine-tune runs locally (e.g., on laptops with 32GB RAM via Ollama/GGUF) or via HF, allowing customization and offline use.
Base Model
- Original: unsloth/gemma-2-2b-it (2B parameters, instruct-tuned for tasks like generation/editing; quantized to 4-bit for efficiency).
- Architecture: Gemma-2 (Google's lightweight transformer variant, optimized for speed on consumer hardware).
Fine-Tuning Details
- Dataset: Custom JSONL (~200 pairs of noisy/clean German texts, user-generated from audio scenarios鈥攅.g., {"prompt": "ich habe das Ticket erstellt; die die also Nummer ahm genau ist SUP-5555.", "response": "Ich habe das Ticket erstellt; die Nummer ist SUP-5555."}).
- Method: LoRA (Parameter-Efficient Fine-Tuning) with r=16, lora_alpha=32, target_modules=["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"], dropout=0.05, via Unsloth for 2x faster training on quantized models.
- Training: 200 steps, effective batch size=16 (per_device=4, accumulation=4), learning_rate=2e-4, optimizer=adamw_8bit, on Colab T4 GPU. No eval set (small dataset); monitored via loss logs.
- Quantization: Exported as Q4_K_M GGUF (~1.5GB) for local inference (balances quality/speed; runs on CPU/GPU).
- Hardware: Tested on ASUS Zenbook (Ryzen 9, 32GB RAM) for local runs.
Usage
Local Inference with Ollama
- Pull:
ollama pull vallehorn/german-audio-correction-gemma2:q4_k_m - Run:
ollama run vallehorn/german-audio-correction-gemma2 - Prompt example: "ich habe das Ticket erstellt; die die also Nummer ahm genau ist SUP-5555."
Expected output: "Ich habe das Ticket erstellt; die Nummer ist SUP-5555."
Use the Modelfile for custom params (e.g., temperature=0.7).
Python Inference (via Unsloth/HF)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained("ValleHorn/german-audio-correction-gemma2")
model = FastLanguageModel.for_inference(model)
messages = [{"role": "user", "content": "Noisy German text here"}]
inputs = tokenizer.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(input_ids=inputs, max_new_tokens=128, temperature=0.7)
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
- Downloads last month
- 117
Model tree for ValleHorn/german-audio-correction-gemma2
Base model
unsloth/gemma-2-2b-it