Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: health-ai-developer-foundations
|
| 4 |
+
license_link: https://developers.google.com/health-ai-developer-foundations/terms
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: image-text-to-text
|
| 7 |
+
extra_gated_heading: Access MedGemma on Hugging Face
|
| 8 |
+
extra_gated_prompt: To access MedGemma on Hugging Face, you're required to review
|
| 9 |
+
and agree to [Health AI Developer Foundation's terms of use](https://developers.google.com/health-ai-developer-foundations/terms).
|
| 10 |
+
To do this, please ensure you're logged in to Hugging Face and click below. Requests
|
| 11 |
+
are processed immediately.
|
| 12 |
+
extra_gated_button_content: Acknowledge license
|
| 13 |
+
base_model: google/medgemma-27b-text-it
|
| 14 |
+
tags:
|
| 15 |
+
- medical
|
| 16 |
+
- clinical-reasoning
|
| 17 |
+
- thinking
|
| 18 |
+
- mlx
|
| 19 |
+
- mlx-my-repo
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
# mlx-community/medgemma-27b-text-it-bf16
|
| 23 |
+
|
| 24 |
+
The Model [mlx-community/medgemma-27b-text-it-bf16](https://huggingface.co/mlx-community/medgemma-27b-text-it-bf16) was converted to MLX format from [google/medgemma-27b-text-it](https://huggingface.co/google/medgemma-27b-text-it) using mlx-lm version **0.24.1**.
|
| 25 |
+
|
| 26 |
+
## Use with mlx
|
| 27 |
+
|
| 28 |
+
```bash
|
| 29 |
+
pip install mlx-lm
|
| 30 |
+
```
|
| 31 |
+
|
| 32 |
+
```python
|
| 33 |
+
from mlx_lm import load, generate
|
| 34 |
+
|
| 35 |
+
model, tokenizer = load("mlx-community/medgemma-27b-text-it-bf16")
|
| 36 |
+
|
| 37 |
+
prompt="hello"
|
| 38 |
+
|
| 39 |
+
if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
|
| 40 |
+
messages = [{"role": "user", "content": prompt}]
|
| 41 |
+
prompt = tokenizer.apply_chat_template(
|
| 42 |
+
messages, tokenize=False, add_generation_prompt=True
|
| 43 |
+
)
|
| 44 |
+
|
| 45 |
+
response = generate(model, tokenizer, prompt=prompt, verbose=True)
|
| 46 |
+
```
|