Pclanglais commited on
Commit
31b9958
·
verified ·
1 Parent(s): 5caf956

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -105,6 +105,7 @@ def create_bibtex_entry(data):
105
  class CombinedProcessor:
106
  def process(self, user_message):
107
  editorial_text = re.sub("\n", " ¶ ", user_message)
 
108
  num_tokens = len(tokenizer.tokenize(editorial_text))
109
 
110
  batch_prompts = split_text(editorial_text, max_tokens=500) if num_tokens > 500 else [editorial_text]
@@ -117,7 +118,6 @@ class CombinedProcessor:
117
 
118
  bibtex_entries = []
119
  for entry in bibliography_entries:
120
- entry = re.sub(r'\s*([;:])\s*', r' \1 ', entry)
121
  entry = re.sub(r'- ?[\n¶] ?', r'', entry)
122
  entry = re.sub(r' ?[\n¶] ?', r' ', entry)
123
  bib_out = bibliography_classifier(entry)
 
105
  class CombinedProcessor:
106
  def process(self, user_message):
107
  editorial_text = re.sub("\n", " ¶ ", user_message)
108
+ editorial_text = re.sub(r'\s*([;:])\s*', r' \1 ', editorial_text)
109
  num_tokens = len(tokenizer.tokenize(editorial_text))
110
 
111
  batch_prompts = split_text(editorial_text, max_tokens=500) if num_tokens > 500 else [editorial_text]
 
118
 
119
  bibtex_entries = []
120
  for entry in bibliography_entries:
 
121
  entry = re.sub(r'- ?[\n¶] ?', r'', entry)
122
  entry = re.sub(r' ?[\n¶] ?', r' ', entry)
123
  bib_out = bibliography_classifier(entry)