lukecurtin32 commited on
Commit
1eb10d0
·
verified ·
1 Parent(s): cabfb2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -143,7 +143,19 @@ iface = gr.Interface(
143
  title="English to Spanish Translator",
144
  description="Enter English text to translate it into Spanish, with accurate translation of construction and project management terms."
145
  )
146
- transformers
 
 
 
 
 
 
 
 
 
 
 
 
147
 
148
  # Launch the interface
149
  if __name__ == "__main__":
 
143
  title="English to Spanish Translator",
144
  description="Enter English text to translate it into Spanish, with accurate translation of construction and project management terms."
145
  )
146
+ import os
147
+ import subprocess
148
+
149
+ # Install the transformers library if not already installed
150
+ try:
151
+ import transformers
152
+ except ImportError:
153
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "transformers"])
154
+ import transformers
155
+
156
+ from transformers import pipeline
157
+ import gradio as gr
158
+ import re
159
 
160
  # Launch the interface
161
  if __name__ == "__main__":