Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,9 @@ import gradio as gr
|
|
6 |
|
7 |
# Install necessary libraries
|
8 |
libraries = [
|
9 |
-
'transformers',
|
10 |
'gradio',
|
11 |
-
'python-pptx',
|
12 |
]
|
13 |
|
14 |
for library in libraries:
|
@@ -17,16 +17,6 @@ for library in libraries:
|
|
17 |
except subprocess.CalledProcessError as e:
|
18 |
print(f"Error installing {library}: {e}")
|
19 |
|
20 |
-
# Now try to import the libraries
|
21 |
-
try:
|
22 |
-
from pptx import Presentation
|
23 |
-
import re
|
24 |
-
from transformers import pipeline
|
25 |
-
import gradio as gr
|
26 |
-
except ImportError as e:
|
27 |
-
print(f"Error importing required libraries: {e}")
|
28 |
-
exit(1)
|
29 |
-
|
30 |
def extract_text_from_pptx(file_path):
|
31 |
presentation = Presentation(file_path)
|
32 |
|
|
|
6 |
|
7 |
# Install necessary libraries
|
8 |
libraries = [
|
9 |
+
'transformers==4.12.2',
|
10 |
'gradio',
|
11 |
+
'python-pptx==0.6.19',
|
12 |
]
|
13 |
|
14 |
for library in libraries:
|
|
|
17 |
except subprocess.CalledProcessError as e:
|
18 |
print(f"Error installing {library}: {e}")
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
def extract_text_from_pptx(file_path):
|
21 |
presentation = Presentation(file_path)
|
22 |
|