ford442 commited on
Commit
1312d08
·
verified ·
1 Parent(s): 71141f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -138,7 +138,7 @@ def infer(
138
  attention_mask = encoded_inputs["attention_mask"].to(device)
139
  print("-- tokenize prompt --")
140
  # Google T5
141
- input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
142
  outputs = model.generate(
143
  input_ids=input_ids,
144
  attention_mask=attention_mask,
@@ -150,7 +150,6 @@ def infer(
150
  # Use the encoded tensor 'text_inputs' here
151
  enhanced_prompt = tokenizer.decode(outputs[0], skip_special_tokens=True)
152
  print('-- generated prompt --')
153
- print(enhanced_prompt)
154
  enhanced_prompt = filter_text(enhanced_prompt,prompt)
155
  print('-- filtered prompt --')
156
  print(enhanced_prompt)
 
138
  attention_mask = encoded_inputs["attention_mask"].to(device)
139
  print("-- tokenize prompt --")
140
  # Google T5
141
+ #input_ids = tokenizer(input_text, return_tensors="pt").input_ids.to("cuda")
142
  outputs = model.generate(
143
  input_ids=input_ids,
144
  attention_mask=attention_mask,
 
150
  # Use the encoded tensor 'text_inputs' here
151
  enhanced_prompt = tokenizer.decode(outputs[0], skip_special_tokens=True)
152
  print('-- generated prompt --')
 
153
  enhanced_prompt = filter_text(enhanced_prompt,prompt)
154
  print('-- filtered prompt --')
155
  print(enhanced_prompt)