Text Generation
Transformers
PyTorch
English
gpt_neox
causal-lm
Inference Endpoints
text-generation-inference
hardmaru cat-state commited on
Commit
3eda748
1 Parent(s): 0497fe4

Update README.md (#1)

Browse files

- Update README.md (063d1f172a93f19d932262f10a4e51c073c3e5ad)


Co-authored-by: Full name <cat-state@users.noreply.huggingface.co>

Files changed (1) hide show
  1. README.md +20 -1
README.md CHANGED
@@ -31,7 +31,16 @@ tokenizer = AutoTokenizer.from_pretrained("StabilityAI/stablelm-tuned-alpha-3b")
31
  model = AutoModelForCausalLM.from_pretrained("StabilityAI/stablelm-tuned-alpha-3b")
32
  model.half().cuda()
33
 
34
- inputs = tokenizer("What's your mood today?", return_tensors="pt").to("cuda")
 
 
 
 
 
 
 
 
 
35
  tokens = model.generate(
36
  **inputs,
37
  max_new_tokens=64,
@@ -41,6 +50,16 @@ tokens = model.generate(
41
  print(tokenizer.decode(tokens[0], skip_special_tokens=True))
42
  ```
43
 
 
 
 
 
 
 
 
 
 
 
44
  ## Model Details
45
 
46
  * **Developed by**: [Stability AI](https://stability.ai/)
 
31
  model = AutoModelForCausalLM.from_pretrained("StabilityAI/stablelm-tuned-alpha-3b")
32
  model.half().cuda()
33
 
34
+ system_prompt = """<|SYSTEM|># StableLM Tuned (Alpha version)
35
+ - StableLM is a helpful and harmless open-source AI language model developed by StabilityAI.
36
+ - StableLM is excited to be able to help the user, but will refuse to do anything that could be considered harmful to the user.
37
+ - StableLM is more than just an information source, StableLM is also able to write poetry, short stories, and make jokes.
38
+ - StableLM will refuse to participate in anything that could harm a human.
39
+ """
40
+
41
+ prompt = f"{system_prompt}<|USER|>What's your mood today?"
42
+
43
+ inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
44
  tokens = model.generate(
45
  **inputs,
46
  max_new_tokens=64,
 
50
  print(tokenizer.decode(tokens[0], skip_special_tokens=True))
51
  ```
52
 
53
+ StableLM Tuned should be used with prompts formatted to `<|SYSTEM|>...<|USER|>...<|ASSISTANT|>...`
54
+ The system prompt is
55
+ ```
56
+ <|SYSTEM|># StableLM Tuned (Alpha version)
57
+ - StableLM is a helpful and harmless open-source AI language model developed by StabilityAI.
58
+ - StableLM is excited to be able to help the user, but will refuse to do anything that could be considered harmful to the user.
59
+ - StableLM is more than just an information source, StableLM is also able to write poetry, short stories, and make jokes.
60
+ - StableLM will refuse to participate in anything that could harm a human.
61
+ ```
62
+
63
  ## Model Details
64
 
65
  * **Developed by**: [Stability AI](https://stability.ai/)