tritesh commited on
Commit
dde8fce
·
verified ·
1 Parent(s): 638e1e9

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +24 -15
README.md CHANGED
@@ -1,26 +1,35 @@
1
  ---
 
 
 
 
2
  tags:
3
- - ml-intern
 
4
  ---
5
 
6
- # tritesh/gemma-4-31B-it-mlx-2Bit
7
 
8
- <!-- ml-intern-provenance -->
9
- ## Generated by ML Intern
10
 
11
- This model repository was generated by [ML Intern](https://github.com/huggingface/ml-intern), an agent for machine learning research and development on the Hugging Face Hub.
12
 
13
- - Try ML Intern: https://smolagents-ml-intern.hf.space
14
- - Source code: https://github.com/huggingface/ml-intern
15
-
16
- ## Usage
17
 
18
  ```python
19
- from transformers import AutoModelForCausalLM, AutoTokenizer
20
 
21
- model_id = 'tritesh/gemma-4-31B-it-mlx-2Bit'
22
- tokenizer = AutoTokenizer.from_pretrained(model_id)
23
- model = AutoModelForCausalLM.from_pretrained(model_id)
24
- ```
25
 
26
- For non-causal architectures, replace `AutoModelForCausalLM` with the appropriate `AutoModel` class.
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: transformers
3
+ license: apache-2.0
4
+ license_link: https://ai.google.dev/gemma/docs/gemma_4_license
5
+ pipeline_tag: image-text-to-text
6
  tags:
7
+ - mlx
8
+ base_model: google/gemma-4-31B-it
9
  ---
10
 
11
+ # raazkumar/gemma-4-31B-it-mlx-2Bit
12
 
13
+ The Model [raazkumar/gemma-4-31B-it-mlx-2Bit](https://huggingface.co/raazkumar/gemma-4-31B-it-mlx-2Bit) was converted to MLX format from [google/gemma-4-31B-it](https://huggingface.co/google/gemma-4-31B-it) using mlx-lm version **0.31.2**.
 
14
 
15
+ ## Use with mlx
16
 
17
+ ```bash
18
+ pip install mlx-lm
19
+ ```
 
20
 
21
  ```python
22
+ from mlx_lm import load, generate
23
 
24
+ model, tokenizer = load("raazkumar/gemma-4-31B-it-mlx-2Bit")
 
 
 
25
 
26
+ prompt="hello"
27
+
28
+ if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
29
+ messages = [{"role": "user", "content": prompt}]
30
+ prompt = tokenizer.apply_chat_template(
31
+ messages, tokenize=False, add_generation_prompt=True
32
+ )
33
+
34
+ response = generate(model, tokenizer, prompt=prompt, verbose=True)
35
+ ```