Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,6 @@
|
|
| 1 |
-
import spacy
|
| 2 |
import os
|
| 3 |
-
import shutil
|
| 4 |
import gradio as gr
|
| 5 |
import subprocess
|
| 6 |
-
from booknlp.booknlp import BookNLP
|
| 7 |
-
from spacy.cli import download
|
| 8 |
|
| 9 |
# Define function to convert ebook to txt using Calibre
|
| 10 |
def convert_to_txt(input_file):
|
|
@@ -15,6 +11,14 @@ def convert_to_txt(input_file):
|
|
| 15 |
|
| 16 |
# Define function to process file
|
| 17 |
def process_book(file):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
input_file = file.name
|
| 19 |
output_dir = "output_dir/booknlp_output/"
|
| 20 |
book_id = os.path.splitext(os.path.basename(input_file))[0]
|
|
|
|
|
|
|
| 1 |
import os
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import subprocess
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Define function to convert ebook to txt using Calibre
|
| 6 |
def convert_to_txt(input_file):
|
|
|
|
| 11 |
|
| 12 |
# Define function to process file
|
| 13 |
def process_book(file):
|
| 14 |
+
import shutil
|
| 15 |
+
import spacy
|
| 16 |
+
from booknlp.booknlp import BookNLP
|
| 17 |
+
from spacy.cli import download
|
| 18 |
+
|
| 19 |
+
#This will download the booknlp files using my huggingface backup
|
| 20 |
+
import download_missing_booknlp_models
|
| 21 |
+
|
| 22 |
input_file = file.name
|
| 23 |
output_dir = "output_dir/booknlp_output/"
|
| 24 |
book_id = os.path.splitext(os.path.basename(input_file))[0]
|