Josebert commited on
Commit
589d7c5
·
verified ·
1 Parent(s): 0e24aad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
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")