Spaces:
Runtime error
Runtime error
🚸 add guide
Browse filesSigned-off-by: peter szemraj <[email protected]>
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import contextlib
|
| 2 |
import logging
|
| 3 |
import random
|
|
@@ -185,7 +186,7 @@ def load_uploaded_file(file_obj, max_pages=20):
|
|
| 185 |
|
| 186 |
if __name__ == "__main__":
|
| 187 |
logging.info("Starting app instance")
|
| 188 |
-
|
| 189 |
logging.info("Loading summ models")
|
| 190 |
with contextlib.redirect_stdout(None):
|
| 191 |
model, tokenizer = load_model_and_tokenizer(
|
|
@@ -217,7 +218,7 @@ if __name__ == "__main__":
|
|
| 217 |
|
| 218 |
gr.Markdown("## Load Inputs & Select Parameters")
|
| 219 |
gr.Markdown(
|
| 220 |
-
"Enter text below in the text area. The text will be summarized [using the selected parameters](https://huggingface.co/blog/how-to-generate). Optionally load an example below or upload a file. (`.txt` or `.pdf`)"
|
| 221 |
)
|
| 222 |
with gr.Row(variant='compact'):
|
| 223 |
with gr.Column(scale=0.5, variant='compact'):
|
|
|
|
| 1 |
+
import os
|
| 2 |
import contextlib
|
| 3 |
import logging
|
| 4 |
import random
|
|
|
|
| 186 |
|
| 187 |
if __name__ == "__main__":
|
| 188 |
logging.info("Starting app instance")
|
| 189 |
+
os.environ["TOKENIZERS_PARALLELISM"] = "false" # parallelism on tokenizers is buggy with gradio
|
| 190 |
logging.info("Loading summ models")
|
| 191 |
with contextlib.redirect_stdout(None):
|
| 192 |
model, tokenizer = load_model_and_tokenizer(
|
|
|
|
| 218 |
|
| 219 |
gr.Markdown("## Load Inputs & Select Parameters")
|
| 220 |
gr.Markdown(
|
| 221 |
+
"Enter text below in the text area. The text will be summarized [using the selected parameters](https://huggingface.co/blog/how-to-generate). Optionally load an example below or upload a file. (`.txt` or `.pdf` - _[link to guide](https://i.imgur.com/c6Cs9ly.png)_)"
|
| 222 |
)
|
| 223 |
with gr.Row(variant='compact'):
|
| 224 |
with gr.Column(scale=0.5, variant='compact'):
|