Downloads · 30 days
9
1% of all-time downloads
RichardErkhov/shijunju_-_gemma_2b_finRisk-gguf
shijunju_-_gemma_2b_finRisk-gguf is a machine learning model from RichardErkhov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
9
1% of all-time downloads
All-time downloads
704
Public
Repo size
30.7 GB
Likes
0
Public
Click a slice to open those files.
.gguf35.6 GB · 100%
From the Hugging Face model README
Quantization made by Richard Erkhov.
gemma_2b_finRisk - GGUF
| Name | Quant method | Size |
|---|---|---|
| gemma_2b_finRisk.Q2_K.gguf | Q2_K | 1.08GB |
| gemma_2b_finRisk.IQ3_XS.gguf | IQ3_XS | 1.16GB |
| gemma_2b_finRisk.IQ3_S.gguf | IQ3_S | 1.2GB |
| gemma_2b_finRisk.Q3_K_S.gguf | Q3_K_S | 1.2GB |
| gemma_2b_finRisk.IQ3_M.gguf | IQ3_M | 1.22GB |
| gemma_2b_finRisk.Q3_K.gguf | Q3_K | 1.29GB |
| gemma_2b_finRisk.Q3_K_M.gguf | Q3_K_M | 1.29GB |
| gemma_2b_finRisk.Q3_K_L.gguf | Q3_K_L | 1.36GB |
| gemma_2b_finRisk.IQ4_XS.gguf | IQ4_XS | 1.4GB |
| gemma_2b_finRisk.Q4_0.gguf | Q4_0 | 1.44GB |
| gemma_2b_finRisk.IQ4_NL.gguf | IQ4_NL | 1.45GB |
| gemma_2b_finRisk.Q4_K_S.gguf | Q4_K_S | 1.45GB |
| gemma_2b_finRisk.Q4_K.gguf | Q4_K | 1.52GB |
| gemma_2b_finRisk.Q4_K_M.gguf | Q4_K_M | 1.52GB |
| gemma_2b_finRisk.Q4_1.gguf | Q4_1 | 1.56GB |
| gemma_2b_finRisk.Q5_0.gguf | Q5_0 | 1.68GB |
| gemma_2b_finRisk.Q5_K_S.gguf | Q5_K_S | 1.68GB |
| gemma_2b_finRisk.Q5_K.gguf | Q5_K | 1.71GB |
| gemma_2b_finRisk.Q5_K_M.gguf | Q5_K_M | 1.71GB |
| gemma_2b_finRisk.Q5_1.gguf | Q5_1 | 1.79GB |
| gemma_2b_finRisk.Q6_K.gguf | Q6_K | 1.92GB |
| gemma_2b_finRisk.Q8_0.gguf | Q8_0 | 2.49GB |
This model is fine-tuned using the LoRA (Low-Rank Adaptation) approach, specifically designed for question answering in the domain of financial risk compliance.
The Gemma-2b-en model is fine-tuned using documents from fincen.gov.
It is capable of answering questions about documents published on fincen.gov, including Alerts, Advisories, and Financial Trend Analysis reports since 2020.
shijunju/fincen_all_questions_5versions
Use the code below to get started with the model. (Faster if using GPU.)
import torch
model_id = "shijunju/gemma_2b_finRisk"
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto",
token=os.environ['HF_TOKEN'])
tokenizer = AutoTokenizer.from_pretrained(model_id, token=os.environ['HF_TOKEN'])
# Function to generate responses
def generate_response(prompt, max_length=256):
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs,
temperature = 0.2,
max_length=max_length,
num_return_sequences=1)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
question = "Describe the increase in average monthly values of Real Estate Business Email Compromise incidents from 2020 to 2021."
inference_template = """<start_of_turn>user\nQuestion: {question}\n<end_of_turn>\n\n<start_of_turn>model\n"""
prompt = inference_template.format(
question=question,
response=""
)
print(generate_response(prompt))