Instructions to use jphme/em_german_13b_v01 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jphme/em_german_13b_v01 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jphme/em_german_13b_v01")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jphme/em_german_13b_v01") model = AutoModelForCausalLM.from_pretrained("jphme/em_german_13b_v01") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use jphme/em_german_13b_v01 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jphme/em_german_13b_v01" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jphme/em_german_13b_v01", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/jphme/em_german_13b_v01
- SGLang
How to use jphme/em_german_13b_v01 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 "jphme/em_german_13b_v01" \ --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": "jphme/em_german_13b_v01", "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 "jphme/em_german_13b_v01" \ --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": "jphme/em_german_13b_v01", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use jphme/em_german_13b_v01 with Docker Model Runner:
docker model run hf.co/jphme/em_german_13b_v01
Prompt Format for RAG with Memory
I want to thank you for your work. The model works really well!
However, I have a problem with RAG with memory.
Could you send me a prompt template with RAG + Memory ?
If I just put the chat history into the RAG template it doesn't work.
Thanks in advance
I want to thank you for your work. The model works really well!
However, I have a problem with RAG with memory.
Could you send me a prompt template with RAG + Memory ?
If I just put the chat history into the RAG template it doesn't work.Thanks in advance
Could you share an example? Due to the prompt format, you cant use "USER:" or "ASSISTANT:" in your prompts without the model getting confused (probably I will also switch to ChatML for the next version).
I have used something like this:
Du bist ein hilfreicher Assistent. Für die folgende Aufgabe stehen dir zwischen den tags BEGININPUT und ENDINPUT mehrere Quellen zur Verfügung. Metadaten zu den einzelnen Quellen wie Autor, URL o.ä. sind zwischen BEGINCONTEXT und ENDCONTEXT zu finden, danach folgt der Text der Quelle. Die eigentliche Aufgabe oder Frage ist zwischen BEGININSTRUCTION und ENDINCSTRUCTION zu finden. Beantworte diese wortwörtlich mit einem Zitat aus den Quellen. Sollten diese keine Antwort enthalten, antworte, dass auf Basis der gegebenen Informationen keine Antwort möglich ist! USER: BEGININPUT
BEGINCONTEXT
ENDCONTEXT
Chat History: {chat history}
Context: {context}
ENDINPUT
BEGININSTRUCTION {question} ENDINSTRUCTION ASSISTANT:
I have tried to use it without any sources.
I have used something like this:
Du bist ein hilfreicher Assistent. Für die folgende Aufgabe stehen dir zwischen den tags BEGININPUT und ENDINPUT mehrere Quellen zur Verfügung. Metadaten zu den einzelnen Quellen wie Autor, URL o.ä. sind zwischen BEGINCONTEXT und ENDCONTEXT zu finden, danach folgt der Text der Quelle. Die eigentliche Aufgabe oder Frage ist zwischen BEGININSTRUCTION und ENDINCSTRUCTION zu finden. Beantworte diese wortwörtlich mit einem Zitat aus den Quellen. Sollten diese keine Antwort enthalten, antworte, dass auf Basis der gegebenen Informationen keine Antwort möglich ist! USER: BEGININPUT
BEGINCONTEXT
ENDCONTEXT
Chat History: {chat history}
Context: {context}
ENDINPUT
BEGININSTRUCTION {question} ENDINSTRUCTION ASSISTANT:I have tried to use it without any sources.
I am not surprised the model is confused by this. The training dataset didn't contain any examples of multi-turn conversations with the special RAG template, but generally I would recommend to just prepend the Chat history like normal (USER: .... ASSISTANT: ..... USER: .... ASSISTANT: ....) or (if its an unrelated chat history) try converting it into a format thats very different from the main template (e.g. JSON).
If you would describe your use case in more detail, that would be helpful to add training data for this scenario/use case for future model versions...
Okay thanks, I will check, if I can improve my results. I will get back to you afterwards.