Downloads · 30 days
4
3% of all-time downloads
Dhruvil47/falcon-7b-bioarxiv-qa
falcon-7b-bioarxiv-qa is a machine learning model from Dhruvil47. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
Downloads · 30 days
4
3% of all-time downloads
All-time downloads
142
Public
Repo size
522 MB
Likes
0
Public
Click a slice to open those files.
.safetensors522 MB · 99%
From the Hugging Face model README
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model = "Dhruvil47/falcon-7b-bioarxiv-qa"
tokenizer = AutoTokenizer.from_pretrained(model)
pipeline = transformers.pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
torch_dtype=torch.bfloat16,
trust_remote_code=True,
device_map="auto",
)
input_prompt = "Question: Are group 2 innate lymphoid cells ( ILC2s ) increased in chronic rhinosinusitis with nasal polyps or eosinophilia?\nAnswer:"
sequences = pipeline(
input_prompt,
max_length=300,
do_sample=True,
top_k=10,
num_return_sequences=1,
eos_token_id=tokenizer.eos_token_id,
)
for seq in sequences:
generated_text = seq['generated_text'].split("\nQuestion:")[0]
generated_text = generated_text.replace(input_prompt, "").strip()
print(generated_text)