olegshulyakov commited on
Commit
08f294f
·
verified ·
1 Parent(s): ecbad60

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +48 -0
README.md ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: gemma
4
+ license_link: https://ai.google.dev/gemma/terms
5
+ pipeline_tag: text-generation
6
+ extra_gated_heading: Access CodeGemma on Hugging Face
7
+ extra_gated_prompt: To access CodeGemma on Hugging Face, you’re required to review
8
+ and agree to Google’s usage license. To do this, please ensure you’re logged-in
9
+ to Hugging Face and click below. Requests are processed immediately.
10
+ extra_gated_button_content: Acknowledge license
11
+ widget:
12
+ - text: '<start_of_turn>user Write a Python function to calculate the nth fibonacci
13
+ number.<end_of_turn> <start_of_turn>model
14
+
15
+ '
16
+ inference:
17
+ parameters:
18
+ max_new_tokens: 200
19
+ tags:
20
+ - mlx
21
+ base_model: google/codegemma-1.1-7b-it
22
+ ---
23
+
24
+ # mlx-community/codegemma-1.1-7b-it-6bit
25
+
26
+ The Model [mlx-community/codegemma-1.1-7b-it-6bit](https://huggingface.co/mlx-community/codegemma-1.1-7b-it-6bit) was converted to MLX format from [google/codegemma-1.1-7b-it](https://huggingface.co/google/codegemma-1.1-7b-it) using mlx-lm version **0.24.1**.
27
+
28
+ ## Use with mlx
29
+
30
+ ```bash
31
+ pip install mlx-lm
32
+ ```
33
+
34
+ ```python
35
+ from mlx_lm import load, generate
36
+
37
+ model, tokenizer = load("mlx-community/codegemma-1.1-7b-it-6bit")
38
+
39
+ prompt="hello"
40
+
41
+ if hasattr(tokenizer, "apply_chat_template") and tokenizer.chat_template is not None:
42
+ messages = [{"role": "user", "content": prompt}]
43
+ prompt = tokenizer.apply_chat_template(
44
+ messages, tokenize=False, add_generation_prompt=True
45
+ )
46
+
47
+ response = generate(model, tokenizer, prompt=prompt, verbose=True)
48
+ ```