Text Generation
PyTorch
Safetensors
English
openlm
mamba
linear
Eval Results
sedrickkeh commited on
Commit
4678449
1 Parent(s): 8037865

model usage

Browse files
Files changed (1) hide show
  1. README.md +4 -5
README.md CHANGED
@@ -112,15 +112,14 @@ This model was trained using [OpenLM](https://github.com/mlfoundations/open_lm/)
112
  ```python
113
  from transformers import AutoTokenizer, AutoModelForCausalLM
114
  tokenizer = AutoTokenizer.from_pretrained("tri-ml/mamba-7b-rw")
115
- model = AutoModelForCausalLM.from_pretrained("tri-ml/mamba-7b-rw").cuda()
116
 
117
- inputs = tokenizer(["A beautiful flower"], return_tensors="pt")
118
- gen_kwargs = {"max_length": 128, "top_p": 0.8, "temperature": 0.8, "do_sample": True, "repetition_penalty": 1.1}
119
  output = model.generate(inputs['input_ids'], **gen_kwargs)
120
  output = tokenizer.decode(output[0].tolist(), skip_special_tokens=True)
121
  print(output)
122
- # <s> A beautiful flower box made of white rose wood. It is a perfect gift for weddings, birthdays and anniversaries.
123
- # All the roses are from our farm Roses Flanders. Therefor you know that these flowers last much longer than those in store or online!</s>
124
  ```
125
 
126
 
 
112
  ```python
113
  from transformers import AutoTokenizer, AutoModelForCausalLM
114
  tokenizer = AutoTokenizer.from_pretrained("tri-ml/mamba-7b-rw")
115
+ model = AutoModelForCausalLM.from_pretrained("tri-ml/mamba-7b-rw")
116
 
117
+ inputs = tokenizer(["The Toyota Supra"], return_tensors="pt")
118
+ gen_kwargs = {"max_new_tokens": 50, "top_p": 0.8, "temperature": 0.8, "do_sample": True, "repetition_penalty": 1.1}
119
  output = model.generate(inputs['input_ids'], **gen_kwargs)
120
  output = tokenizer.decode(output[0].tolist(), skip_special_tokens=True)
121
  print(output)
122
+ # The Toyota Supra is a sports car that has been in production since 1978. The car was discontinued in 2002, but it has recently been revived and will be available again in 2020. The Supra has always been known for its powerful engines and agile handling.
 
123
  ```
124
 
125