Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,14 @@ import tempfile
|
|
| 4 |
import gradio as gr
|
| 5 |
import requests
|
| 6 |
from docx import Document
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# Retrieve the API token from the environment
|
| 9 |
api_token = os.getenv("API_TOKEN")
|
|
|
|
| 4 |
import gradio as gr
|
| 5 |
import requests
|
| 6 |
from docx import Document
|
| 7 |
+
import subprocess
|
| 8 |
+
import sys
|
| 9 |
+
|
| 10 |
+
try:
|
| 11 |
+
from docx import Document
|
| 12 |
+
except ModuleNotFoundError:
|
| 13 |
+
subprocess.check_call([sys.executable, "-m", "pip", "install", "python-docx"])
|
| 14 |
+
from docx import Document
|
| 15 |
|
| 16 |
# Retrieve the API token from the environment
|
| 17 |
api_token = os.getenv("API_TOKEN")
|