atifsial123 commited on
Commit
6feb7ec
·
verified ·
1 Parent(s): 77603ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py CHANGED
@@ -1,4 +1,16 @@
1
  import os
 
 
 
 
 
 
 
 
 
 
 
 
2
  import pandas as pd
3
  import gradio as gr
4
  from transformers import AutoModel, AutoTokenizer
@@ -62,3 +74,4 @@ if __name__ == "__main__":
62
  iface.launch()
63
 
64
 
 
 
1
  import os
2
+ import subprocess
3
+
4
+ # Function to install a package if it is not already installed
5
+ def install(package):
6
+ subprocess.check_call([os.sys.executable, "-m", "pip", "install", package])
7
+
8
+ # Ensure the necessary packages are installed
9
+ install("transformers")
10
+ install("torch")
11
+ install("pandas")
12
+ install("gradio")
13
+
14
  import pandas as pd
15
  import gradio as gr
16
  from transformers import AutoModel, AutoTokenizer
 
74
  iface.launch()
75
 
76
 
77
+