Kkaastr commited on
Commit
b7bc002
·
verified ·
1 Parent(s): ec2eda2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +24 -1
README.md CHANGED
@@ -42,7 +42,30 @@ Fine-tuning was done using ORPO. The dataset was generated using GPT-4o (selecte
42
 
43
  ### Direct Use
44
 
45
- <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  [More Information Needed]
48
 
 
42
 
43
  ### Direct Use
44
 
45
+ ```python
46
+ import transformers
47
+ import torch
48
+
49
+ model_id = "Kkaastr/Devple-8B"
50
+
51
+ pipeline = transformers.pipeline(
52
+ "text-generation",
53
+ model=model_id,
54
+ model_kwargs={"torch_dtype": torch.bfloat16},
55
+ device_map="auto",
56
+ )
57
+
58
+ messages = [
59
+ {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
60
+ {"role": "user", "content": "Who are you?"},
61
+ ]
62
+
63
+ outputs = pipeline(
64
+ messages,
65
+ max_new_tokens=256,
66
+ )
67
+ print(outputs[0]["generated_text"][-1])
68
+ ```
69
 
70
  [More Information Needed]
71