sedrickkeh commited on
Commit
36ea211
1 Parent(s): fc925c2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -0
README.md CHANGED
@@ -52,6 +52,28 @@ The model was trained using the following setup:
52
 
53
  For more detailed training information, please refer to Section 3.4 and Appendix F of the DCLM paper.
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  ## Evaluation
56
  Here are the evaluation results for DCLM-1B models on various tasks (using [llm-foundry](https://github.com/mosaicml/llm-foundry) eval suite)
57
 
 
52
 
53
  For more detailed training information, please refer to Section 3.4 and Appendix F of the DCLM paper.
54
 
55
+
56
+ ## Quickstart
57
+ First install open_lm
58
+ ```
59
+ pip install git+https://github.com/mlfoundations/open_lm.git
60
+ ```
61
+
62
+ Then you can load the model using HF's Auto classes as follows:
63
+ ```python
64
+ from open_lm.hf import *
65
+ from transformers import AutoTokenizer, AutoModelForCausalLM
66
+ tokenizer = AutoTokenizer.from_pretrained("TRI-ML/DCLM-1B-IT")
67
+ model = AutoModelForCausalLM.from_pretrained("TRI-ML/DCLM-1B")
68
+
69
+ inputs = tokenizer(["Machine learning is"], return_tensors="pt")
70
+ gen_kwargs = {"max_new_tokens": 50, "top_p": 0.8, "temperature": 0.8, "do_sample": True, "repetition_penalty": 1.1}
71
+ output = model.generate(inputs['input_ids'], **gen_kwargs)
72
+ output = tokenizer.decode(output[0].tolist(), skip_special_tokens=True)
73
+ print(output)
74
+ ```
75
+
76
+
77
  ## Evaluation
78
  Here are the evaluation results for DCLM-1B models on various tasks (using [llm-foundry](https://github.com/mosaicml/llm-foundry) eval suite)
79