Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: other
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: text-generation
|
| 6 |
+
inference: false
|
| 7 |
+
tags:
|
| 8 |
+
- transformers
|
| 9 |
+
- gguf
|
| 10 |
+
- imatrix
|
| 11 |
+
- OpenCodeInterpreter-DS-6.7B
|
| 12 |
+
---
|
| 13 |
+
Quantizations of https://huggingface.co/deepseek-ai/m-a-p/OpenCodeInterpreter-DS-6.7B
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
# From original readme
|
| 17 |
+
|
| 18 |
+
## Model Usage
|
| 19 |
+
### Inference
|
| 20 |
+
|
| 21 |
+
```python
|
| 22 |
+
import torch
|
| 23 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 24 |
+
model_path="m-a-p/OpenCodeInterpreter-DS-6.7B"
|
| 25 |
+
|
| 26 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 27 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 28 |
+
model_path,
|
| 29 |
+
torch_dtype=torch.bfloat16,
|
| 30 |
+
device_map="auto",
|
| 31 |
+
)
|
| 32 |
+
model.eval()
|
| 33 |
+
|
| 34 |
+
prompt = "Write a function to find the shared elements from the given two lists."
|
| 35 |
+
inputs = tokenizer.apply_chat_template(
|
| 36 |
+
[{'role': 'user', 'content': prompt }],
|
| 37 |
+
return_tensors="pt"
|
| 38 |
+
).to(model.device)
|
| 39 |
+
outputs = model.generate(
|
| 40 |
+
inputs,
|
| 41 |
+
max_new_tokens=1024,
|
| 42 |
+
do_sample=False,
|
| 43 |
+
pad_token_id=tokenizer.eos_token_id,
|
| 44 |
+
eos_token_id=tokenizer.eos_token_id,
|
| 45 |
+
)
|
| 46 |
+
print(tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True))
|
| 47 |
+
```
|