Views
No views yet
Are SAT scores required?SAT scores are not required for admission, but test scores are used as part of Brockport's holistic review process to make admissions decisions.
Who can I contact for help with financial aid?You can contact the financial aid office at SUNY Brockport for assistance with financial aid. They are available to answer any questions and help you navigate the financial aid process.
Below is an inquiry related to SUNY Brockport - from academics, admissions, and faculty support to student life. Prioritize accuracy and brevity.### Instruction:
{question}### Response:
{response}
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
3import textwrap
4
5bnb_config = BitsAndBytesConfig(
6 load_in_4bit=True,
7 bnb_4bit_quant_type="nf4",
8 bnb_4bit_compute_dtype=torch.bfloat16,
9)
10
11model = AutoModelForCausalLM.from_pretrained(
12 "msaad02/llama2_7b_brockportgpt",
13 quantization_config=bnb_config,
14 device_map={"": 0},
15 trust_remote_code=True
16)
17
18tokenizer = AutoTokenizer.from_pretrained("msaad02/llama2_7b_brockportgpt")
19
20# Use a pipeline as a high-level helper
21from transformers import pipeline
22
23pipe = pipeline(
24 task="text-generation",
25 model=model,
26 tokenizer=tokenizer
27)
28
29def qa(text: str, full = False):
30 # textwrap.dedent gets rid of indenting at the start of each newline
31 text = textwrap.dedent(f"""\
32 Below is an inquiry related to SUNY Brockport - from academics, admissions, and faculty support to student life. Prioritize accuracy and brevity.
33
34 ### Instruction:
35 {text}
36
37 ### Response:
38 """)
39
40 response = pipe(text, max_length=100, do_sample=True, top_k=50, top_p=0.95, temperature=1.0)
41 response = response[0]['generated_text']
42 response = response.split("### Response:\n")[1] if not full else response
43
44 return response
45
46print(qa("How do I apply?", full = True))