Instructions to use KnutJaegersberg/KafkaLM-8x7B-German with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KnutJaegersberg/KafkaLM-8x7B-German with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KnutJaegersberg/KafkaLM-8x7B-German")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KnutJaegersberg/KafkaLM-8x7B-German") model = AutoModelForCausalLM.from_pretrained("KnutJaegersberg/KafkaLM-8x7B-German") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use KnutJaegersberg/KafkaLM-8x7B-German with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KnutJaegersberg/KafkaLM-8x7B-German" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KnutJaegersberg/KafkaLM-8x7B-German", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/KnutJaegersberg/KafkaLM-8x7B-German
- SGLang
How to use KnutJaegersberg/KafkaLM-8x7B-German 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 "KnutJaegersberg/KafkaLM-8x7B-German" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KnutJaegersberg/KafkaLM-8x7B-German", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "KnutJaegersberg/KafkaLM-8x7B-German" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KnutJaegersberg/KafkaLM-8x7B-German", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use KnutJaegersberg/KafkaLM-8x7B-German with Docker Model Runner:
docker model run hf.co/KnutJaegersberg/KafkaLM-8x7B-German
KafkaLM-8x7b-German-V0.1
KafkaLM 8x7b is a MoE model based on Mistral AI´s Mixtral 8x7b which was finetuned on an ensemble of popular high-quality open-source instruction sets (translated from English to German).
KafkaLM 8x7b is a Seedbox project trained by Dennis Dickmann.
Why Kafka? The models are proficient, yet creative, have some tendencies to linguistically push boundaries 😊
Model Details
The purpose of releasing the KafkaLM series is to contribute to the German AI community with a set of fine-tuned LLMs that are easy to use in everyday applications across a variety of tasks.
The main goal was to provide LLMs proficient in German, especially to be used in German-speaking business contexts where English alone is not sufficient.
Dataset
I used a 8k filtered version of the following seedboxai/multitask_german_examples_32k
Prompt Format
This model follows the subsequent prompt format:
<|system|>
Du bist ein freundlicher und hilfsbereiter KI-Assistent. Du beantwortest Fragen faktenorientiert und präzise, ohne dabei relevante Fakten auszulassen.</s>
<|user|>
Welche Möglichkeiten der energetischen Sanierung habe ich neben Solar und Energiespeicher?</s>
<|assistant|>
Inference
Getting started with the model is straightforward
import transformers
model_id = "seedboxai/KafkaLM-8x7B-German-V0.1"
model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True, trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained(model_id)
def generate_prompt(input):
prompt = ''
sys_prompt = "Du bist ein freundlicher und hilfsbereiter KI-Assistent. Du beantwortest Fragen faktenorientiert und präzise, ohne dabei relevante Fakten auszulassen."
prompt += f"<|system|>\n{sys_prompt.strip()}</s>\n"
prompt += f"<|user|>\n{input.strip()}</s>\n"
prompt += f"<|assistant|>\n"
return prompt.strip()
generate_text = transformers.pipeline(
model=model, tokenizer=tokenizer,
return_full_text=True,
task='text-generation',
temperature=0.5,
max_new_tokens=512,
top_p=0.95,
top_k=40,
do_sample=True,
)
print(generate_text(generate_prompt("Wer ist eigentlich dieser Kafka?"))
Disclaimer
The license on this model does not constitute legal advice. We are not responsible for the actions of third parties who use this model. This model should only be used for research purposes. The original Llama2 license and all restrictions of datasets used to train this model apply.
- Downloads last month
- 1
