axnand commited on
Commit
da047a9
·
1 Parent(s): 307a792

max length in the rephraser model modified

Browse files
Files changed (1) hide show
  1. app/services/rephraser.py +1 -0
app/services/rephraser.py CHANGED
@@ -62,6 +62,7 @@ def rephrase_text(text: str, tone: str = "general") -> str:
62
  prompt = f"Rephrase in a {tone} tone without introductory phrases:\n{text} </s>"
63
 
64
  inputs = tokenizer([prompt], return_tensors="pt", padding=True, truncation=True).to(device)
 
65
  max_length = min(int(input_length * 1.3), 1024)
66
  outputs = model.generate(
67
  **inputs,
 
62
  prompt = f"Rephrase in a {tone} tone without introductory phrases:\n{text} </s>"
63
 
64
  inputs = tokenizer([prompt], return_tensors="pt", padding=True, truncation=True).to(device)
65
+ input_length = inputs['input_ids'].shape[1]
66
  max_length = min(int(input_length * 1.3), 1024)
67
  outputs = model.generate(
68
  **inputs,