Update README.md
Browse files
README.md
CHANGED
@@ -6,7 +6,7 @@ language:
|
|
6 |
pipeline_tag: text-generation
|
7 |
---
|
8 |
|
9 |
-
**VERIFIED
|
10 |
# BrockportGPT GGUF LLaMA2 Finetune
|
11 |
|
12 |
> This is a quantized version of the original model, found at "msaad02/llama2_7b_brockportgpt"
|
@@ -38,4 +38,45 @@ This prompting style is what was used for finetuning:
|
|
38 |
|
39 |
## Usage
|
40 |
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
pipeline_tag: text-generation
|
7 |
---
|
8 |
|
9 |
+
**VERIFIED 8/25/23**
|
10 |
# BrockportGPT GGUF LLaMA2 Finetune
|
11 |
|
12 |
> This is a quantized version of the original model, found at "msaad02/llama2_7b_brockportgpt"
|
|
|
38 |
|
39 |
## Usage
|
40 |
|
41 |
+
GGUF is the current state of the art model, started being supported for llama.cpp on August 23rd, 2023. Today is August 25th, so pretty recent, you could say! GGML is its predacessor and has since been depricated.
|
42 |
+
|
43 |
+
To use, I recommend using ctransformers, but you can also use the llama.cpp library directly as well. Be sure that you have the most updated versions, ctransformers required version >=0.2.24 for gguf support, and llama.cpp python bindings does not yet support it -- you need to be careful
|
44 |
+
|
45 |
+
```python
|
46 |
+
from ctransformers import AutoModelForCausalLM
|
47 |
+
import textwrap
|
48 |
+
|
49 |
+
llm = AutoModelForCausalLM.from_pretrained(
|
50 |
+
model_path_or_repo_id="msaad02/llama2_7b_brockportgpt_gguf",
|
51 |
+
model_file="brockportgpt-7b-q4_1.gguf",
|
52 |
+
model_type="llama"
|
53 |
+
)
|
54 |
+
|
55 |
+
def qa(text: str, full = False):
|
56 |
+
# textwrap.dedent gets rid of indenting at the start of each newline
|
57 |
+
text = textwrap.dedent(f"""\
|
58 |
+
Below is an inquiry related to SUNY Brockport - from academics, admissions, and faculty support to student life. Prioritize accuracy and brevity.
|
59 |
+
|
60 |
+
### Instruction:
|
61 |
+
{text}
|
62 |
+
|
63 |
+
### Response:
|
64 |
+
""")
|
65 |
+
|
66 |
+
response = llm(text, max_new_tokens=256)
|
67 |
+
response = (text + response) if full else response
|
68 |
+
|
69 |
+
return response
|
70 |
+
|
71 |
+
qa("How do I apply?")
|
72 |
+
> You can apply for admission to the University by completing an application online or by mailing a paper copy of the application to SUNY Brockport (available only through PDF upload).
|
73 |
+
|
74 |
+
print(qa("How do I apply?", full=True))
|
75 |
+
> Below is an inquiry related to SUNY Brockport - from academics, admissions, and faculty support to student life. Prioritize accuracy and brevity.
|
76 |
+
>
|
77 |
+
> ### Instruction:
|
78 |
+
> How do I apply?
|
79 |
+
>
|
80 |
+
> ### Response:
|
81 |
+
> You can apply for admission to the English department at SUNY Brockport by following the application process outlined on their website.
|
82 |
+
```
|