Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# NeuroBLAST 1.9B Instruct Early Preview
|
| 6 |
+
|
| 7 |
+
*WIP*
|
| 8 |
+
|
| 9 |
+
### Inference code
|
| 10 |
+
|
| 11 |
+
```python
|
| 12 |
+
import torch
|
| 13 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
| 14 |
+
|
| 15 |
+
torch.random.manual_seed(0)
|
| 16 |
+
|
| 17 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 18 |
+
"meditsolutions/NeuroBLAST-1.9B-Instruct-Early-Preview",
|
| 19 |
+
device_map="cuda",
|
| 20 |
+
torch_dtype=torch.bfloat16,
|
| 21 |
+
trust_remote_code=True,
|
| 22 |
+
)
|
| 23 |
+
|
| 24 |
+
tokenizer = AutoTokenizer.from_pretrained("meditsolutions/NeuroBLAST-1.9B-Instruct-Early-Preview")
|
| 25 |
+
|
| 26 |
+
messages = [
|
| 27 |
+
{"role": "user", "content": "What is enalapril?"},
|
| 28 |
+
]
|
| 29 |
+
|
| 30 |
+
pipe = pipeline(
|
| 31 |
+
"text-generation",
|
| 32 |
+
model=model,
|
| 33 |
+
tokenizer=tokenizer,
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
+
generation_args = {
|
| 37 |
+
"max_new_tokens": 500,
|
| 38 |
+
"return_full_text": False,
|
| 39 |
+
"temperature": 0.0,
|
| 40 |
+
"do_sample": False,
|
| 41 |
+
}
|
| 42 |
+
|
| 43 |
+
output = pipe(messages, **generation_args)
|
| 44 |
+
print(output[0]['generated_text'])
|
| 45 |
+
```
|