Natwar commited on
Commit
f44ef6f
·
verified ·
1 Parent(s): 0f15ab4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -1,4 +1,9 @@
1
- !pip install --quiet gradio==3.50.2 matplotlib numpy torch transformers
 
 
 
 
 
2
 
3
  import gradio as gr
4
  import matplotlib.pyplot as plt
@@ -110,4 +115,5 @@ demo = gr.Interface(
110
  )
111
 
112
  # Launch the app
113
- demo.launch()
 
 
1
+ import subprocess
2
+ import sys
3
+
4
+ # Install required packages
5
+ subprocess.check_call([sys.executable, "-m", "pip", "install",
6
+ "gradio==3.50.2", "matplotlib", "numpy", "torch", "transformers"])
7
 
8
  import gradio as gr
9
  import matplotlib.pyplot as plt
 
115
  )
116
 
117
  # Launch the app
118
+ if __name__ == "__main__":
119
+ demo.launch()