Aityz commited on
Commit
1c340be
1 Parent(s): 510e497

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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. \n### Instruction: {instruction} \n### 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. \n### Instruction: {instruction} \n### 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())
 
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())