Update app.py
Browse files
app.py
CHANGED
@@ -7,9 +7,9 @@ model = AutoModelForCausalLM.from_pretrained('Aityz/Aityz-3B')
|
|
7 |
|
8 |
def generate(instruction, input = None, maxtokens: int = 20):
|
9 |
if input is not None:
|
10 |
-
ln = f'Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
11 |
if input is None:
|
12 |
-
ln = f'Below is an instruction that describes a task. Write a response that appropriately completes the request.
|
13 |
inputs = tokenizer(ln, return_tensors="pt")
|
14 |
output = model.generate(inputs=inputs['input_ids'], max_new_tokens=maxtokens)
|
15 |
return tokenizer.decode(output[0].tolist())
|
|
|
7 |
|
8 |
def generate(instruction, input = None, maxtokens: int = 20):
|
9 |
if input is not None:
|
10 |
+
ln = f'Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: {instruction} ### Input: {input} \n### Response:'
|
11 |
if input is None:
|
12 |
+
ln = f'Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: {instruction} ### Response:'
|
13 |
inputs = tokenizer(ln, return_tensors="pt")
|
14 |
output = model.generate(inputs=inputs['input_ids'], max_new_tokens=maxtokens)
|
15 |
return tokenizer.decode(output[0].tolist())
|