Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -154,6 +154,7 @@ class CombinedProcessor:
|
|
| 154 |
def process(self, user_message):
|
| 155 |
editorial_text = re.sub("\n", " ¶ ", user_message)
|
| 156 |
editorial_text = re.sub(r'\s*([;:,\.])\s*', r' \1 ', editorial_text)
|
|
|
|
| 157 |
num_tokens = len(tokenizer.tokenize(editorial_text))
|
| 158 |
|
| 159 |
batch_prompts = split_text(editorial_text, max_tokens=500) if num_tokens > 500 else [editorial_text]
|
|
@@ -166,6 +167,7 @@ class CombinedProcessor:
|
|
| 166 |
|
| 167 |
bibtex_entries = []
|
| 168 |
for entry in bibliography_entries:
|
|
|
|
| 169 |
entry = re.sub(r'- ?[\n¶] ?', r'', entry)
|
| 170 |
entry = re.sub(r' ?[\n¶] ?', r' ', entry)
|
| 171 |
bib_out = bibliography_classifier(entry)
|
|
|
|
| 154 |
def process(self, user_message):
|
| 155 |
editorial_text = re.sub("\n", " ¶ ", user_message)
|
| 156 |
editorial_text = re.sub(r'\s*([;:,\.])\s*', r' \1 ', editorial_text)
|
| 157 |
+
print(editorial_text)
|
| 158 |
num_tokens = len(tokenizer.tokenize(editorial_text))
|
| 159 |
|
| 160 |
batch_prompts = split_text(editorial_text, max_tokens=500) if num_tokens > 500 else [editorial_text]
|
|
|
|
| 167 |
|
| 168 |
bibtex_entries = []
|
| 169 |
for entry in bibliography_entries:
|
| 170 |
+
print(entry)
|
| 171 |
entry = re.sub(r'- ?[\n¶] ?', r'', entry)
|
| 172 |
entry = re.sub(r' ?[\n¶] ?', r' ', entry)
|
| 173 |
bib_out = bibliography_classifier(entry)
|