Cachoups commited on
Commit
1b25a35
·
verified ·
1 Parent(s): 13fe061

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -20,7 +20,8 @@ def preprocess_for_bm25(text):
20
  text = text.replace("...", " _ELLIPSIS_ ")
21
 
22
  # Add space before and after punctuation (except "_ELLIPSIS_")
23
- text = re.sub(r'([.,!?()"])', r' \1 ', text)
 
24
 
25
  # Restore "..." from the placeholder
26
  text = text.replace("_ELLIPSIS_", "...")
@@ -92,7 +93,7 @@ llm = HuggingFaceHub(
92
  #repo_id="google-bert/bert-base-uncased",
93
  model_kwargs={
94
  "temperature": 0.1,
95
- "max_length": 1,
96
  "return_full_text": False
97
  }
98
  )
 
20
  text = text.replace("...", " _ELLIPSIS_ ")
21
 
22
  # Add space before and after punctuation (except "_ELLIPSIS_")
23
+ text = re.sub(r'([.,!?()"\'])', r' \1 ', text)
24
+
25
 
26
  # Restore "..." from the placeholder
27
  text = text.replace("_ELLIPSIS_", "...")
 
93
  #repo_id="google-bert/bert-base-uncased",
94
  model_kwargs={
95
  "temperature": 0.1,
96
+ "max_length": 5,
97
  "return_full_text": False
98
  }
99
  )