Update README.md
Browse files
README.md
CHANGED
@@ -34,4 +34,27 @@ Each dataset contributed 20,000 data points to the training process, ensuring a
|
|
34 |
- If interested in contributing or experimenting with this model, please feel free to reach out or access the code directly from my Kaggle profile.
|
35 |
|
36 |
## Contact Information
|
37 |
-
- For any inquiries, suggestions, or collaboration proposals, please contact
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
- If interested in contributing or experimenting with this model, please feel free to reach out or access the code directly from my Kaggle profile.
|
35 |
|
36 |
## Contact Information
|
37 |
+
- For any inquiries, suggestions, or collaboration proposals, please contact
|
38 |
+
|
39 |
+
```python
|
40 |
+
!pip install -qU transformers accelerate
|
41 |
+
|
42 |
+
from transformers import AutoTokenizer
|
43 |
+
import transformers
|
44 |
+
import torch
|
45 |
+
|
46 |
+
model = "Kukedlc/NeuralExperiment-7b-MagicCoder-v7"
|
47 |
+
messages = [{"role": "user", "content": "What is a large language model?"}]
|
48 |
+
|
49 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
50 |
+
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
|
51 |
+
pipeline = transformers.pipeline(
|
52 |
+
"text-generation",
|
53 |
+
model=model,
|
54 |
+
torch_dtype=torch.float16,
|
55 |
+
device_map="auto",
|
56 |
+
)
|
57 |
+
|
58 |
+
outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
|
59 |
+
print(outputs[0]["generated_text"])
|
60 |
+
```
|