初始化项目,由ModelHub XC社区提供模型

Model: QuantFactory/Llama-3-8B-Instruct-Finance-RAG-GGUF
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-10-13 06:30:13 +08:00
commit af82c7f826
17 changed files with 276 additions and 0 deletions

49
.gitattributes vendored Normal file
View File

@@ -0,0 +1,49 @@
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q4_1.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q4_0.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q6_K.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q5_K_S.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q5_0.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q5_1.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q2_K.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q3_K_L.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q3_K_M.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q3_K_S.gguf filter=lfs diff=lfs merge=lfs -text
Llama-3-8B-Instruct-Finance-RAG.Q4_K_S.gguf filter=lfs diff=lfs merge=lfs -text

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d7fc898691c749b1d3f920acee81a1ea1b105223a88c5989895189c1a6019972
size 3179169760

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1fafffa06512d25b5a5c6f9b874f7e1e8c3d5ba141f779aff39054e24d2e1a74
size 4321998048

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:54beadddb7d98d2e25aae027f7ad3ffb19f41f88fb438cfa4956924e54880c2a
size 4018959584

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:483604cb7378e9bcd89cac3a0892918978a9ed6df33ddbbf5177646e0f9d05fe
size 3664540896

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b7ee6401136ba83fe8b20d1782afafb7e41965180f2ffd7e21401f5c7c299077
size 4661257696

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:86e709f9ae7b4d0b486ad26ca83736133bf17f3a1c9d5756797deaf375836273
size 5130300896

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c061463c0ea636e520d0eb472b12cfc09ce36543ebc3622bbcc1af51fc861883
size 4920780256

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:11481bd3bdd93b592d8ea6f3663c45e03abe08737dc6340f6b02e3c5083709d4
size 4692714976

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:948852de50be90d264485d0f7fec2e040605dd32e93d1647930e6d956b2ed9df
size 5599344096

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a1e2288bf5c1474e0416dff4ec5685f04dc14d1b0c9574d8d38b981296f909cf
size 6068387296

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:47a923be38540d6930e8ac4b26cce7e52e6e5df64a56f50f3c931a5ab64a7874
size 5733037536

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:af102f0fd025ffec8c9b3f639ba60c1826b94d60d0861efa0ef54e8f0a689fe8
size 5599344096

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f43f215008de49316f52d0dbe3a82be45a872b3850035bd42307950f8fbea302
size 6596060896

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c42ce614dbcacd869b374aa3ba56414566bd81e044f7c040589fcb7de241984f
size 8540841184

184
README.md Normal file
View File

@@ -0,0 +1,184 @@
---
library_name: transformers
tags:
- finance
license: llama3
base_model: meta-llama/Meta-Llama-3-8B-Instruct
datasets:
- virattt/financial-qa-10K
language:
- en
pipeline_tag: text-generation
---
[![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
# QuantFactory/Llama-3-8B-Instruct-Finance-RAG-GGUF
This is quantized version of [curiousily/Llama-3-8B-Instruct-Finance-RAG](https://huggingface.co/curiousily/Llama-3-8B-Instruct-Finance-RAG) created using llama.cpp
# Original Model Card
# Llama 3 8B Instruct (Financial RAG)
This model is a fine-tuned version of the original [Llama 3 8B Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct) model
on 4000 examples from the [virattt/financial-qa-10K](https://huggingface.co/datasets/virattt/financial-qa-10K) dataset.
The model is fine-tuned using a LoRA adapter for RAG use cases. It is optimized to answer a question based on a context:
```txt
Answer the question:
{question}
Using the information:
{context}
```
## Usage
Load the model:
```py
MODEL_NAME = "curiousily/Llama-3-8B-Instruct-Finance-RAG"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(
MODEL_NAME,
device_map="auto"
)
pipe = pipeline(
task="text-generation",
model=model,
tokenizer=tokenizer,
max_new_tokens=128,
return_full_text=False,
)
```
Format the prompt (uses the original Instruct prompt format):
````py
prompt = """
<|begin_of_text|><|start_header_id|>system<|end_header_id|>
Use only the information to answer the question<|eot_id|><|start_header_id|>user<|end_header_id|>
How much did the company's net earnings amount to in fiscal 2022?
Information:
```
Net earnings were $17.1 billion in fiscal 2022.
```<|eot_id|><|start_header_id|>assistant<|end_header_id|>
"""
````
And make a prediction:
```py
print(outputs[0]["generated_text"])
```
```
$17.1 billion
```
Here's a helper function to build your prompts:
```py
def create_test_prompt(data_row):
prompt = dedent(f"""
{data_row["question"]}
Information:
```
{data_row["context"]}
```
""")
messages = [
{"role": "system", "content": "Use only the information to answer the question"},
{"role": "user", "content": prompt},
]
return tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
```
Where `data_row` must be a dict:
```
data_row = {
"question": "...",
"context": "..."
}
```
## Sample Predictions
Here's a sample of the predictions from *trained* and *untrained* models
```txt
Example 1
answer: Delta Air Lines' agreements with its regional carriers typically last at least ten years with options for extensions. Delta controls operational aspects like scheduling and pricing.
trained: Delta Connection agreements typically last at least ten years with options for extensions.
untrained: According to the information, the terms of Delta Air Lines' agreements with its regional carriers through Delta Connection are:
1. The agreements typically last at least ten years.
2. There are options for extensions.
3. Delta controls major operational aspects like scheduling and pricing.
4. The regional carriers supply the services.
Example 2
answer: The company evaluates acquisition-related intangibles for impairment by comparing the asset's carrying amount to undiscounted future net cash flows expected from the asset. An impairment loss is recognized if the carrying amount exceeds the asset's recoverable amount.
trained: The company evaluates acquisition-related intangible and other long-lived assets for impairment whenever events or changes in circumstances indicate that the carrying amount may not be recoverable. This involves measuring the recoverability of the asset by comparing its carrying amount to the future undiscounted net cash flows expected to be generated by the asset group.
untrained: According to the information, the company uses the following criteria to determine whether an impairment loss should be recognized on acquisition-related intangible assets:
* Events or changes in circumstances that indicate the carrying amount of an asset may not be recoverable.
* A comparison of the carrying amount of an asset to future undiscounted net cash flows expected to be generated by the asset group.
In other words, the company evaluates whether the asset's carrying amount is recoverable by comparing it to the expected future cash flows, which involves assumptions about future prospects and computations of estimated future cash flows.
Example 3
answer: In the United States, the approval process for biosimilars is governed by the Public Health Service Act (PHSA) and the regulations implementing these statutes, specifically including provisions made under federal health care reform legislation enacted in March 2010.
trained: The Federal Food, Drug, and Cosmetic Act (the FFDCA) and the Public Health Service Act (PHSA)
untrained: The legal framework that governs the approval process for biosimilars in the United States is the Federal Food, Drug, and Cosmetic Act (FFDCA) and the Public Health Service Act (PHSA), as well as the regulations implementing these statutes.
Example 4
answer: Timothy S. Teter holds a B.S. degree in Mechanical Engineering from the University of California at Davis and a J.D. degree from Stanford Law School.
trained: B.S. in Mechanical Engineering from the University of California at Davis and a J.D. from Stanford Law School
untrained: According to the information, Timothy S. Teter holds:
1. A B.S. degree in Mechanical Engineering from the University of California at Davis.
2. A J.D. degree from Stanford Law School.
Example 5
answer: Beginning in fiscal year 2024, the company plans to exclude paused Connected Fitness subscriptions from its new 'Ending Paid Connected Fitness Subscriptions' metric and will treat a pause action as a churn event in its 'Average Net Monthly Paid Connected Fitness Subscription Churn' metric.
trained: Starting in fiscal year 2024, the company will no longer include paused Connected Fitness subscriptions in their Ending Paid Connected Fitness Subscriptions metric and will treat a pause action as a churn event in their Average Net Monthly Paid Connected Fitness Subscription Churn.
untrained: Starting in fiscal year 2024, the company will:
* No longer include paused Connected Fitness subscriptions in the Ending Paid Connected Fitness Subscriptions metric
* Treat a pause action as a churn event in the Average Net Monthly Paid Connected Fitness Subscription Churn
```
## License
Uses the original Llama 3 License.
A custom commercial license is available at: https://llama.meta.com/llama3/license

1
configuration.json Normal file
View File

@@ -0,0 +1 @@
{"framework": "pytorch", "task": "text-generation", "allow_remote": true}