Update README.md
Browse files
README.md
CHANGED
@@ -108,6 +108,14 @@ from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
|
108 |
|
109 |
tokenizer = AutoTokenizer.from_pretrained("zjunlp/chatcell-small")
|
110 |
model = AutoModelForSeq2SeqLM.from_pretrained("zjunlp/chatcell-small")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
```
|
112 |
|
113 |
|
|
|
108 |
|
109 |
tokenizer = AutoTokenizer.from_pretrained("zjunlp/chatcell-small")
|
110 |
model = AutoModelForSeq2SeqLM.from_pretrained("zjunlp/chatcell-small")
|
111 |
+
input_text="Detail the 100 starting genes for a Mix, ranked by expression level: "
|
112 |
+
# Encode the input text and generate a response with specified generation parameters
|
113 |
+
input_ids = tokenizer(input_text,return_tensors="pt").input_ids
|
114 |
+
output_ids = model.generate(input_ids, max_length=512, num_return_sequences=1, no_repeat_ngram_size=2, top_k=50, top_p=0.95, do_sample=True)
|
115 |
+
# Decode and print the generated output text
|
116 |
+
output_text = tokenizer.decode(output_ids[0],skip_special_tokens=True)
|
117 |
+
print(output_text)
|
118 |
+
|
119 |
```
|
120 |
|
121 |
|