Initial model upload with custom code
Browse files
README.md
CHANGED
|
@@ -9,7 +9,7 @@ tags:
|
|
| 9 |
- qwen2
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
This repository contains the weights and custom code for the **fredzzp/open-dcoder-0.5B** model, a masked diffusion model for code generation based on the Qwen2 architecture.
|
| 15 |
|
|
@@ -21,9 +21,11 @@ First, make sure you have the latest `transformers` library installed.
|
|
| 21 |
|
| 22 |
```bash
|
| 23 |
pip install transformers torch huggingface_hub
|
|
|
|
| 24 |
|
| 25 |
-
You can then use the model for generation. Note: You must pass trust_remote_code=True to load the custom model architecture.
|
| 26 |
|
|
|
|
|
|
|
| 27 |
import torch
|
| 28 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 29 |
|
|
@@ -56,3 +58,4 @@ generated_text = tokenizer.decode(outputs.sequences[0][prompt_len:], skip_specia
|
|
| 56 |
|
| 57 |
print("--- Generated Code ---")
|
| 58 |
print(generated_text)
|
|
|
|
|
|
| 9 |
- qwen2
|
| 10 |
---
|
| 11 |
|
| 12 |
+
## Open Diffusion Large Language Models for Code Generation
|
| 13 |
|
| 14 |
This repository contains the weights and custom code for the **fredzzp/open-dcoder-0.5B** model, a masked diffusion model for code generation based on the Qwen2 architecture.
|
| 15 |
|
|
|
|
| 21 |
|
| 22 |
```bash
|
| 23 |
pip install transformers torch huggingface_hub
|
| 24 |
+
```
|
| 25 |
|
|
|
|
| 26 |
|
| 27 |
+
You can then use the model for generation. Note: You must pass trust_remote_code=True to load the custom model architecture.
|
| 28 |
+
```python
|
| 29 |
import torch
|
| 30 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 31 |
|
|
|
|
| 58 |
|
| 59 |
print("--- Generated Code ---")
|
| 60 |
print(generated_text)
|
| 61 |
+
```
|