perlthoughts
commited on
Commit
•
58c578e
1
Parent(s):
ccdf90b
Update README.md
Browse files
README.md
CHANGED
@@ -47,15 +47,19 @@ model_id = "NurtureAI/llama-2-7b-int4-gptq-python"
|
|
47 |
tokenizer = AutoTokenizer.from_pretrained(hf_model_repo)
|
48 |
model = AutoModelForCausalLM.from_pretrained(
|
49 |
hf_model_repo, load_in_4bit=True,
|
50 |
-
torch_dtype=torch.float16, device_map=device_map
|
|
|
51 |
instruction="Write a Python function to display the first and last elements of a list."
|
52 |
input=""
|
53 |
prompt = f"""### Instruction:
|
54 |
Use the Task below and the Input given to write the Response, which is a programming code that can solve the Task.
|
|
|
55 |
### Task:
|
56 |
{instruction}
|
|
|
57 |
### Input:
|
58 |
{input}
|
|
|
59 |
### Response:
|
60 |
"""
|
61 |
input_ids = tokenizer(prompt, return_tensors="pt", truncation=True).input_ids.cuda()
|
|
|
47 |
tokenizer = AutoTokenizer.from_pretrained(hf_model_repo)
|
48 |
model = AutoModelForCausalLM.from_pretrained(
|
49 |
hf_model_repo, load_in_4bit=True,
|
50 |
+
torch_dtype=torch.float16, device_map=device_map,
|
51 |
+
)
|
52 |
instruction="Write a Python function to display the first and last elements of a list."
|
53 |
input=""
|
54 |
prompt = f"""### Instruction:
|
55 |
Use the Task below and the Input given to write the Response, which is a programming code that can solve the Task.
|
56 |
+
|
57 |
### Task:
|
58 |
{instruction}
|
59 |
+
|
60 |
### Input:
|
61 |
{input}
|
62 |
+
|
63 |
### Response:
|
64 |
"""
|
65 |
input_ids = tokenizer(prompt, return_tensors="pt", truncation=True).input_ids.cuda()
|