Spaces:
Runtime error
Runtime error
samarthagarwal23
commited on
Commit
•
472a794
1
Parent(s):
7e61444
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,8 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
2 |
from gradio.mix import Series
|
3 |
import re
|
4 |
from rank_bm25 import BM25Okapi
|
@@ -6,7 +10,7 @@ import string
|
|
6 |
from transformers import pipeline
|
7 |
import pdfminer
|
8 |
from pdfminer.high_level import extract_text
|
9 |
-
from termcolor import colored
|
10 |
|
11 |
def read_pdf(file):
|
12 |
text = extract_text(file)
|
|
|
1 |
import gradio as gr
|
2 |
+
import os
|
3 |
+
|
4 |
+
os.system("pip install pdfminer.six rank_bm25")
|
5 |
+
|
6 |
from gradio.mix import Series
|
7 |
import re
|
8 |
from rank_bm25 import BM25Okapi
|
|
|
10 |
from transformers import pipeline
|
11 |
import pdfminer
|
12 |
from pdfminer.high_level import extract_text
|
13 |
+
#from termcolor import colored
|
14 |
|
15 |
def read_pdf(file):
|
16 |
text = extract_text(file)
|