naot97 commited on
Commit
ac2d9b2
1 Parent(s): 0552491

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -3
app.py CHANGED
@@ -84,8 +84,6 @@ def evaluate(
84
  top_k=40,
85
  num_beams=4,
86
  max_new_tokens=128,
87
- print('instruction: ', instruction)
88
- return instruction
89
  prompt = instruction
90
  inputs = tokenizer(prompt, return_tensors="pt")
91
  input_ids = inputs["input_ids"].to(device)
@@ -106,7 +104,7 @@ def evaluate(
106
  )
107
  s = generation_output.sequences[0]
108
  output = tokenizer.decode(s)
109
- return output.split("### Response:")[1].strip()
110
 
111
 
112
  g = gr.Interface(
 
84
  top_k=40,
85
  num_beams=4,
86
  max_new_tokens=128,
 
 
87
  prompt = instruction
88
  inputs = tokenizer(prompt, return_tensors="pt")
89
  input_ids = inputs["input_ids"].to(device)
 
104
  )
105
  s = generation_output.sequences[0]
106
  output = tokenizer.decode(s)
107
+ return output[len(input_ids):]
108
 
109
 
110
  g = gr.Interface(