Update README.md
Browse files
README.md
CHANGED
@@ -20,38 +20,21 @@ Model based on `bardsai/jaskier-7b-dpo-v5.6` (downstream version of Mistral7B) f
|
|
20 |
|
21 |
You can use this model directly with a Hugging Face pipeline:
|
22 |
```python
|
23 |
-
import ...
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
messages = [{'messages':[{
|
28 |
-
"role": "user",
|
29 |
-
"content": "How much is 2+2"
|
30 |
-
}]},
|
31 |
-
{'messages':[{
|
32 |
-
"role": "user",
|
33 |
-
"content": "Tell me where the nearest water park is?"
|
34 |
-
}]},
|
35 |
-
]
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
"do_sample": True,
|
43 |
-
"temperature": 0.7,
|
44 |
-
"max_new_tokens": 1024,
|
45 |
-
}
|
46 |
-
model_outputs = [out[-1]['content'] for out in p(conversations(), **generate_kwargs)]
|
47 |
-
|
48 |
-
print(model_outputs)
|
49 |
|
50 |
```
|
51 |
|
52 |
## Output
|
53 |
|
54 |
-
|
55 |
|
56 |
## Changelog
|
57 |
|
|
|
20 |
|
21 |
You can use this model directly with a Hugging Face pipeline:
|
22 |
```python
|
|
|
23 |
|
24 |
+
from transformers import pipeline, Conversation
|
25 |
+
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
|
27 |
+
base_model_name = "bardsai/jaskier-7b-dpo-v6.1"
|
28 |
+
chatbot = pipeline("conversational", model=base_model_name, torch_dtype=torch.float16, device_map="auto")
|
29 |
+
conversation = Conversation("Can Poland into space?")
|
30 |
+
conversation = chatbot(conversation)
|
31 |
+
print(conversation.messages[-1]["content"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
```
|
34 |
|
35 |
## Output
|
36 |
|
37 |
+
"Poland, as a nation, doesn't physically travel to space. However, Poland has contributed to the field of space exploration through its scientists, engineers, and collaborations with international space agencies. The Polish Space Agency, established in 2016, aims to promote and coordinate the country's space activities."
|
38 |
|
39 |
## Changelog
|
40 |
|