PY007 commited on
Commit
07bcbfe
•
1 Parent(s): 8eaca27

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -6
README.md CHANGED
@@ -31,7 +31,7 @@ Do check the [TinyLlama](https://github.com/jzhang38/TinyLlama) github page for
31
  from transformers import AutoTokenizer
32
  import transformers
33
  import torch
34
- model = "PY007/TinyLlama-1.1B-step-50K-105b"
35
  tokenizer = AutoTokenizer.from_pretrained(model)
36
  pipeline = transformers.pipeline(
37
  "text-generation",
@@ -40,14 +40,20 @@ pipeline = transformers.pipeline(
40
  device_map="auto",
41
  )
42
 
 
 
 
 
 
 
43
  sequences = pipeline(
44
- 'The TinyLlama project aims to pretrain a 1.1B Llama model on 3 trillion tokens. With some proper optimization, we can achieve this within a span of "just" 90 days using 16 A100-40G GPUs 🚀🚀. The training has started on 2023-09-01.',
45
  do_sample=True,
46
- top_k=10,
 
47
  num_return_sequences=1,
48
- repetition_penalty=1.5,
49
- eos_token_id=tokenizer.eos_token_id,
50
- max_length=500,
51
  )
52
  for seq in sequences:
53
  print(f"Result: {seq['generated_text']}")
 
31
  from transformers import AutoTokenizer
32
  import transformers
33
  import torch
34
+ model = "PY007/TinyLlama-1.1B-Chat-v0.1"
35
  tokenizer = AutoTokenizer.from_pretrained(model)
36
  pipeline = transformers.pipeline(
37
  "text-generation",
 
40
  device_map="auto",
41
  )
42
 
43
+ prompt = "What are the values in open source projects?"
44
+ formatted_prompt = (
45
+ f"### Human: {prompt} ### Assistant:"
46
+ )
47
+
48
+
49
  sequences = pipeline(
50
+ formatted_prompt,
51
  do_sample=True,
52
+ top_k=50,
53
+ top_p = 0.7,
54
  num_return_sequences=1,
55
+ repetition_penalty=1.1,
56
+ max_new_tokens=500,
 
57
  )
58
  for seq in sequences:
59
  print(f"Result: {seq['generated_text']}")