Downloads · 30 days
5
9% of all-time downloads
insomeniaT/falcon-7b-uae-qapairs-67
falcon-7b-uae-qapairs-67 is a text generation model from insomeniaT. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This repository contains a fine-tuned model based on the PEFT framework for question answering tasks. The model has been trained on a dataset of question and answer pairs related to the UAE.
Downloads · 30 days
5
9% of all-time downloads
All-time downloads
58
Public
Repo size
261 MB
Likes
1
Public
Click a slice to open those files.
.bin131 MB · 100%
From the Hugging Face model README
This repository contains a fine-tuned model based on the PEFT framework for question answering tasks. The model has been trained on a dataset of question and answer pairs related to the UAE.
Before using the model, make sure to install the necessary packages:
pip install transformers
pip install torch torchvision
pip install peft
The model can be used for generating responses to prompts. Here is an example:
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
peft_model_id = "insomeniaT/falcon-7b-uae-qapairs-67"
config = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, trust_remote_code=True)
model = PeftModel.from_pretrained(model, peft_model_id)
tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-7b")
tokenizer.pad_token = tokenizer.eos_token
text = "### Human: What is the minimum requirement for the UAE's GCC residency?? ### Assistant: "
device = "cuda:0"
inputs = tokenizer(text, return_tensors="pt")
inputs.to(device)
model.to(device)
outputs = model.generate(input_ids=inputs["input_ids"], attention_mask=inputs["attention_mask"], max_new_tokens=300, pad_token_id=tokenizer.eos_token_id)
result = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(result)