Downloads · 30 days
16
23% of all-time downloads
justsomerandomdude264/SocialScience_Homework_Solver_Llama318B
SocialScience_Homework_Solver_Llama318B is a text generation model from justsomerandomdude264. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
This is a Large Language Model (LLM) fine-tuned to solve sst problems with detailed, step-by-step explanations and accurate answers. The base model used is Llama 3.1 with 8 billion parameters, which has been quantized…
Downloads · 30 days
16
23% of all-time downloads
All-time downloads
71
Public
Parameters
8.2B
5.9 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors5.9 GB · 100%
How the weights are stored.
U87.2B · 87%
From the Hugging Face model README
This is a Large Language Model (LLM) fine-tuned to solve sst problems with detailed, step-by-step explanations and accurate answers. The base model used is Llama 3.1 with 8 billion parameters, which has been quantized to 4-bit using QLoRA (Quantized Low-Rank Adaptation) and PEFT (Parameter-Efficient Fine-Tuning) through the Unsloth framework.
Other Homework Solver Models include Math_Homework_Solver_Llama318B and Science_Homework_Solver_Llama318B
The SocialScience Homework Solver model is designed to assist with a broad spectrum of evs and sst problems, from medieval history to adavanced economics. It provides clear and detailed explanations, making it an excellent resource for students, educators, and anyone looking to deepen their understanding of sst concepts.
By leveraging the Llama 3.1 base model and fine-tuning it using PEFT and QLoRA, this model achieves high-quality performance while maintaining a relatively small computational footprint, making it accessible even on limited hardware.
To start using the Math Homework Solver model, follow these steps:
Clone the repo
git clone https://huggingface.co/justsomerandomdude264/SocialScience_Homework_Solver-Llama3.18B
Run inference
from unsloth import FastLanguageModel
import torch
# Define Your Question
question = "Analyze the socio-political and economic factors that contributed to the rise and fall of the Byzantine Empire from the reign of Justinian I to the fall of Constantinople in 1453. How did internal conflicts, religious controversies, and external pressures from both Islamic caliphates and Western European powers shape the trajectory of the empire over this period?" # Example Question, You can change it with one of your own
# Load the model
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "SocialScience_Homework_Solver_Llama318B/model_adapters", # The dir where the repo is cloned or "\\" for root
max_seq_length = 2048,
dtype = None,
load_in_4bit = True,
)
# Set the model in inference model
FastLanguageModel.for_inference(model)
# QA template
qa_template = """Question: {}
Answer: {}"""
# Tokenize inputs
inputs = tokenizer(
[
qa_template.format(
question, # Question
"", # Answer - left blank for generation
)
], return_tensors = "pt").to("cuda")
# Stream the answer/output of the model
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer)
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 512)
from transformers import LlamaForCausalLM, AutoTokenizer
# Load the model
model = LlamaForCausalLM.from_pretrained(
"justsomerandomdude264/SocialScience_Homework_Solver_Llama318B",
device_map="auto"
)
# Load the tokenizer
tokenizer = AutoTokenizer.from_pretrained("justsomerandomdude264/SocialScience_Homework_Solver_Llama318B")
# Set the inputs up
qa_template = """Question: {}
Answer: {}"""
inputs = tokenizer(
[
qa_template.format(
"Who was Akbar?", # Question
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
# Do a forward pass
outputs = model.generate(**inputs, max_new_tokens = 128, use_cache = True)
raw_output = str(tokenizer.batch_decode(outputs))
# Formtting the string
# Removing the list brackets and splitting the string by newline characters
formatted_string = raw_output.strip("[]").replace("<|begin_of_text|>", "").replace("<|eot_id|>", "").strip("''").split("\\n")
# Print the lines one by one
for line in formatted_string:
print(line)
Please use the following citation if you reference the Math Homework Solver model:
@misc{paliwal2024,
author = {Krishna Paliwal},
title = {Contributions to SocialScience_Homework_Solver},
year = {2024},
email = {[email protected]}
}
Paliwal, Krishna (2024). Contributions to SocialScience_Homework_Solver. Email: [email protected] .