Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
library_name: peft
|
3 |
+
base_model: tiiuae/falcon-7b
|
4 |
+
---
|
5 |
+
|
6 |
+
### Direct Use
|
7 |
+
|
8 |
+
```python
|
9 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
10 |
+
import transformers
|
11 |
+
import torch
|
12 |
+
|
13 |
+
model = "Dhruvil47/falcon-7b-bioarxiv-qa"
|
14 |
+
|
15 |
+
tokenizer = AutoTokenizer.from_pretrained(model)
|
16 |
+
pipeline = transformers.pipeline(
|
17 |
+
"text-generation",
|
18 |
+
model=model,
|
19 |
+
tokenizer=tokenizer,
|
20 |
+
torch_dtype=torch.bfloat16,
|
21 |
+
trust_remote_code=True,
|
22 |
+
device_map="auto",
|
23 |
+
)
|
24 |
+
sequences = pipeline(
|
25 |
+
"Question: Are group 2 innate lymphoid cells ( ILC2s ) increased in chronic rhinosinusitis with nasal polyps or eosinophilia?\nAnswer:",
|
26 |
+
max_length=1000,
|
27 |
+
do_sample=True,
|
28 |
+
top_k=10,
|
29 |
+
num_return_sequences=1,
|
30 |
+
eos_token_id=tokenizer.eos_token_id,
|
31 |
+
)
|
32 |
+
for seq in sequences:
|
33 |
+
print(f"Result: {seq['generated_text']}")
|
34 |
+
|
35 |
+
```
|