Commit ·
1b8287f
1
Parent(s): 7a07883
Update README.md
Browse files
README.md
CHANGED
|
@@ -87,11 +87,12 @@ model = PeftModel.from_pretrained(model, "TuningAI/Llama2_7B_Cover_letter_genera
|
|
| 87 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf" , trust_remote_code=True)
|
| 88 |
tokenizer.pad_token = tokenizer.eos_token
|
| 89 |
tokenizer.padding_side = "right"
|
|
|
|
| 90 |
while 1:
|
| 91 |
input_text = input(">>>")
|
| 92 |
logging.set_verbosity(logging.CRITICAL)
|
| 93 |
-
prompt = f"### Instruction\n{
|
| 94 |
-
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer,max_length=
|
| 95 |
result = pipe(prompt)
|
| 96 |
print(result[0]['generated_text'].replace(prompt, ''))
|
| 97 |
```
|
|
|
|
| 87 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf" , trust_remote_code=True)
|
| 88 |
tokenizer.pad_token = tokenizer.eos_token
|
| 89 |
tokenizer.padding_side = "right"
|
| 90 |
+
Instruction = "Given a user's information about the target job, you will generate a Cover letter for this job based on this information."
|
| 91 |
while 1:
|
| 92 |
input_text = input(">>>")
|
| 93 |
logging.set_verbosity(logging.CRITICAL)
|
| 94 |
+
prompt = f"### Instruction\n{Instruction}.\n ###Input \n\n{input_text}. ### Output:"
|
| 95 |
+
pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer,max_length=400)
|
| 96 |
result = pipe(prompt)
|
| 97 |
print(result[0]['generated_text'].replace(prompt, ''))
|
| 98 |
```
|