Text Generation
Transformers
Safetensors
gemma2
mergekit
Merge
conversational
text-generation-inference
Instructions to use Gunulhona/Gemma-Med-Merge with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gunulhona/Gemma-Med-Merge with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Gunulhona/Gemma-Med-Merge") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Gunulhona/Gemma-Med-Merge") model = AutoModelForCausalLM.from_pretrained("Gunulhona/Gemma-Med-Merge", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Gunulhona/Gemma-Med-Merge with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Gunulhona/Gemma-Med-Merge" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gunulhona/Gemma-Med-Merge", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Gunulhona/Gemma-Med-Merge
- SGLang
How to use Gunulhona/Gemma-Med-Merge 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 "Gunulhona/Gemma-Med-Merge" \ --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": "Gunulhona/Gemma-Med-Merge", "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 "Gunulhona/Gemma-Med-Merge" \ --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": "Gunulhona/Gemma-Med-Merge", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Gunulhona/Gemma-Med-Merge with Docker Model Runner:
docker model run hf.co/Gunulhona/Gemma-Med-Merge
|
Download README.md from Gunulhona/Gemma-Med-Merge: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/Gunulhona/Gemma-Med-Merge/resolve/main/README.md
- Command line
-
hf download hf://Gunulhona/Gemma-Med-Merge/README.md
-
curl -L -o README.md https://huggingface.co/Gunulhona/Gemma-Med-Merge/resolve/main/README.md
1.62 kB
| base_model: | |
| - Gunulhona/Gemma-Ko-Med | |
| - Shaleen123/gemma2-9b-medical | |
| - valeriojob/MedGPT-Gemma2-9B-BA-v.1 | |
| - ChuGyouk/ko-med-gemma-2-9b-it-merge2 | |
| library_name: transformers | |
| tags: | |
| - mergekit | |
| - merge | |
| # merge | |
| This is a merge of pre-trained language models created using [mergekit](https://github.com/cg123/mergekit). | |
| ## Merge Details | |
| ### Merge Method | |
| This model was merged using the breadcrumbs_ties merge method using [Gunulhona/Gemma-Ko-Med](https://huggingface.co/Gunulhona/Gemma-Ko-Med) as a base. | |
| ### Models Merged | |
| The following models were included in the merge: | |
| * [Shaleen123/gemma2-9b-medical](https://huggingface.co/Shaleen123/gemma2-9b-medical) | |
| * [valeriojob/MedGPT-Gemma2-9B-BA-v.1](https://huggingface.co/valeriojob/MedGPT-Gemma2-9B-BA-v.1) | |
| * [ChuGyouk/ko-med-gemma-2-9b-it-merge2](https://huggingface.co/ChuGyouk/ko-med-gemma-2-9b-it-merge2) | |
| ### Configuration | |
| The following YAML configuration was used to produce this model: | |
| ```yaml | |
| models: | |
| - model: ChuGyouk/ko-med-gemma-2-9b-it-merge2 | |
| layer_range: [0, 42] | |
| parameters: | |
| weight: 1 | |
| density: 0.42 | |
| gamma: 0.03 | |
| - model: Shaleen123/gemma2-9b-medical | |
| layer_range: [0, 42] | |
| parameters: | |
| weight: 1 | |
| density: 0.42 | |
| gamma: 0.03 | |
| - model: valeriojob/MedGPT-Gemma2-9B-BA-v.1 | |
| layer_range: [0, 42] | |
| parameters: | |
| weight: 1 | |
| density: 0.42 | |
| gamma: 0.03 | |
| - model: Gunulhona/Gemma-Ko-Med | |
| layer_range: [0, 42] | |
| parameters: | |
| weight: 1 | |
| density: 0.42 | |
| gamma: 0.09 | |
| merge_method: breadcrumbs_ties | |
| base_model: Gunulhona/Gemma-Ko-Med | |
| dtype: float16 | |
| ``` | |