Update README.md
Browse files
README.md
CHANGED
|
@@ -16,7 +16,7 @@ model = LLaMAForCausalLM.from_pretrained(
|
|
| 16 |
"decapoda-research/llama-7b-hf",
|
| 17 |
load_in_8bit=True,
|
| 18 |
device_map="auto",
|
| 19 |
-
)
|
| 20 |
model = PeftModel.from_pretrained(model, "patulya/alpaca7B-lora")
|
| 21 |
|
| 22 |
PROMPT = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
|
@@ -31,21 +31,20 @@ inputs = tokenizer(
|
|
| 31 |
|
| 32 |
input_ids = inputs["input_ids"].cuda()
|
| 33 |
|
| 34 |
-
generation_config = GenerationConfig(
|
| 35 |
-
temperature=0.6,
|
| 36 |
-
top_p=0.95,
|
| 37 |
-
repetition_penalty=1.15,
|
| 38 |
)
|
| 39 |
|
| 40 |
print("Generating...")
|
| 41 |
|
| 42 |
-
generation_output = model.generate(
|
| 43 |
-
input_ids=input_ids,
|
| 44 |
-
generation_config=generation_config,
|
| 45 |
-
return_dict_in_generate=True,
|
| 46 |
-
output_scores=True,
|
| 47 |
-
max_new_tokens=128,
|
| 48 |
)
|
| 49 |
|
| 50 |
-
for s in generation_output.sequences:
|
| 51 |
-
print(tokenizer.decode(s))
|
|
|
|
| 16 |
"decapoda-research/llama-7b-hf",
|
| 17 |
load_in_8bit=True,
|
| 18 |
device_map="auto",
|
| 19 |
+
)\
|
| 20 |
model = PeftModel.from_pretrained(model, "patulya/alpaca7B-lora")
|
| 21 |
|
| 22 |
PROMPT = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
|
|
|
| 31 |
|
| 32 |
input_ids = inputs["input_ids"].cuda()
|
| 33 |
|
| 34 |
+
generation_config = GenerationConfig(\
|
| 35 |
+
temperature=0.6,\
|
| 36 |
+
top_p=0.95,\
|
| 37 |
+
repetition_penalty=1.15,\
|
| 38 |
)
|
| 39 |
|
| 40 |
print("Generating...")
|
| 41 |
|
| 42 |
+
generation_output = model.generate(\
|
| 43 |
+
input_ids=input_ids,\
|
| 44 |
+
generation_config=generation_config,\
|
| 45 |
+
return_dict_in_generate=True,\
|
| 46 |
+
output_scores=True,\
|
| 47 |
+
max_new_tokens=128,\
|
| 48 |
)
|
| 49 |
|
| 50 |
+
for s in generation_output.sequences: print(tokenizer.decode(s))
|
|
|