Spaces:
Sleeping
Sleeping
John Liao
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,12 @@ except ImportError:
|
|
| 7 |
subprocess.check_call([sys.executable, "-m", "pip", "install", "python-pptx"])
|
| 8 |
import pptx # Import the library after installing it
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
from pptx import Presentation
|
| 11 |
import openai
|
| 12 |
|
|
|
|
| 7 |
subprocess.check_call([sys.executable, "-m", "pip", "install", "python-pptx"])
|
| 8 |
import pptx # Import the library after installing it
|
| 9 |
|
| 10 |
+
try:
|
| 11 |
+
import openai
|
| 12 |
+
except ImportError:
|
| 13 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "openai"])
|
| 14 |
+
import openai # Import the library after installing it
|
| 15 |
+
|
| 16 |
from pptx import Presentation
|
| 17 |
import openai
|
| 18 |
|