We disclaim all responsibility for any harm, inaccuracies, or inappropriate content generated by ArabianGPT-0.3B, and users engage with and apply the model's outputs at their own risk.
You are invited to use ArabianGPT 0.3B Fine-Tuned Model for Question-Answering tasks within a certain dataset range. We suggest reviewing our playground examples to understand the model's capabilities and limitations, especially noting that its performance may decline with questions beyond its trained scope.
import argparse
import torch
from openmind import pipeline, is_torch_npu_available
from openmind_hub import snapshot_download
import time
def parse_args():
parser = argparse.ArgumentParser(description="Eval the model")
parser.add_argument(
"--model_name_or_path",
type=str,
help="Path to the model",
default="zhouhui/ArabianGPT-0.3B-QA",
)
args = parser.parse_args()
return args
def main():
args = parse_args()
model_path = args.model_name_or_path
if is_torch_npu_available():
device = "npu:0"
elif torch.cuda.is_available():
device = "cuda:0"
else:
device = "cpu"
#device = "cpu"
start_time = time.time()
qa = pipeline("question-answering", model=model_path, tokenizer=model_path, device=device)
qa_input = {
"question": "Why is model conversion important?",
"context": "The option on convert models between FARM and openmind gives freedom to the user and let people easily switch between frameworks."
}
ans = qa(qa_input)
print()
print(ans)
print()
end_time = time.time()
print(f"硬件环境:{device},推理执行时间:{end_time - start_time}秒")
if __name__ == "__main__":
main()Special thanks to Prince Sultan University, particularly the Robotics and Internet of Things Lab.
For inquiries: riotu@psu.edu.sa.