MaziyarPanahi
commited on
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
library_name: transformers
|
4 |
+
tags:
|
5 |
+
- mistral
|
6 |
+
- alpaca
|
7 |
+
datasets:
|
8 |
+
- tatsu-lab/alpaca
|
9 |
+
pipeline_tag: text-generation
|
10 |
+
base_model: mistralai/Mistral-7B-v0.1
|
11 |
+
---
|
12 |
+
|
13 |
+
# Description
|
14 |
+
|
15 |
+
`mistralai/Mistral-7B-v0.1` model fine-tuned over 52k alpaca dataset
|
16 |
+
|
17 |
+
# How to use it
|
18 |
+
|
19 |
+
```python
|
20 |
+
# pip install transformers==4.35.2
|
21 |
+
import torch
|
22 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
|
23 |
+
from transformers import pipeline
|
24 |
+
|
25 |
+
model_id="MaziyarPanahi/Mistral-7B-Alpaca-52k-v0.1"
|
26 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
27 |
+
|
28 |
+
streamer = TextStreamer(tokenizer)
|
29 |
+
|
30 |
+
model = AutoModelForCausalLM.from_pretrained(
|
31 |
+
model_id,
|
32 |
+
torch_dtype=torch.float16,
|
33 |
+
device_map="auto",
|
34 |
+
)
|
35 |
+
|
36 |
+
pipe = pipeline(
|
37 |
+
"text-generation",
|
38 |
+
model=model,
|
39 |
+
tokenizer=tokenizer,
|
40 |
+
max_new_tokens=1024,
|
41 |
+
temperature=0.1,
|
42 |
+
do_sample=True,
|
43 |
+
top_p=0.95,
|
44 |
+
repetition_penalty=1.15,
|
45 |
+
return_full_text=False,
|
46 |
+
streamer=streamer
|
47 |
+
)
|
48 |
+
|
49 |
+
prompt = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
50 |
+
|
51 |
+
### Instruction:
|
52 |
+
describe about pros and cons of docker system. Answer in bullet point
|
53 |
+
|
54 |
+
### Response:
|
55 |
+
"""
|
56 |
+
|
57 |
+
res = pipe(prompt)[0]['generated_text']
|
58 |
+
```
|
59 |
+
|
60 |
+
Results:
|
61 |
+
|
62 |
+
```
|
63 |
+
Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
64 |
+
|
65 |
+
### Instruction:
|
66 |
+
describe about pros and cons of docker system. Answer in bullet point
|
67 |
+
|
68 |
+
### Response:
|
69 |
+
Pros of Docker System:
|
70 |
+
- Improved portability - Docker containers can be easily moved between different environments, making it easier to deploy applications across multiple platforms.
|
71 |
+
- Increased security - Containers are isolated from each other, which helps prevent malicious code from spreading throughout the system.
|
72 |
+
- Better resource utilization - Containers allow for better resource management by allowing users to run multiple applications on a single host without having to worry about conflicts or performance issues.
|
73 |
+
|
74 |
+
Cons of Docker System:
|
75 |
+
- Learning curve - It takes time to learn how to use Docker effectively, as there are many commands and concepts involved.
|
76 |
+
- Limited customization options - While Docker provides some basic configuration options, more advanced features such as network routing require additional tools.
|
77 |
+
- Performance overhead - Running multiple containers on a single host may result in slower performance due to increased memory usage.</s>
|
78 |
+
```
|