Downloads · 30 days
7
21% of all-time downloads
amanpreet7/llama-2-7b-uj1
llama-2-7b-uj1 is a machine learning model from amanpreet7. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This is a [task type, e.g., text-generation, question-answering, etc.] model fine-tuned for [specific task or domain, e.g., answering questions about university admission offices]. It has been trained on [brief descri…
Downloads · 30 days
7
21% of all-time downloads
All-time downloads
33
Public
Repo size
27.1 GB
Likes
0
Public
Click a slice to open those files.
.bin13.6 GB · 50%
From the Hugging Face model README
This is a [task type, e.g., text-generation, question-answering, etc.] model fine-tuned for [specific task or domain, e.g., answering questions about university admission offices]. It has been trained on [brief description of training data], and it can generate answers to questions based on the provided context or prompt.
This model is based on [base model name, e.g., GPT-3, T5, BERT] architecture, and has been fine-tuned using [describe fine-tuning method, e.g., LoRA, QLoRA, etc.].
This model is designed to be used for the following tasks:
from transformers import AutoModelForQuestionAnswering, AutoTokenizer
# Load model and tokenizer from local directory
model_path = "./path_to_your_model_directory"
model = AutoModelForQuestionAnswering.from_pretrained(model_path)
tokenizer = AutoTokenizer.from_pretrained(model_path)
# Example Question and Context
question = "What are the contact details for the JAC-2024 Admission Office?"
context = "The contact details for the JAC-2024 Admission Office at University Institute of Engineering & Technology (UIET) are as follows: Address: South Campus, Panjab University, Sector-25, Chandigarh-160014 Phone: 0172-2541242, 2534995."
# Tokenize input
inputs = tokenizer(question, context, return_tensors="pt")
# Get the model's answer
outputs = model(**inputs)
# Get start and end positions for answer
answer_start = outputs.start_logits.argmax()
answer_end = outputs.end_logits.argmax()
# Decode the answer
answer = tokenizer.convert_tokens_to_string(tokenizer.convert_ids_to_tokens(inputs.input_ids[0][answer_start:answer_end+1]))
print("Answer:", answer) # Output: The contact details for the JAC-2024 Admission Office at University Institute of Engineering & Technology (UIET) are as follows: Address: South Campus, Panjab University, Sector-25, Chandigarh-160014 Phone: 0172-2541242, 2534995.