Saliltrehan7 commited on
Commit
b68006c
1 Parent(s): 0a5340f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -1,7 +1,13 @@
1
- !pip install transformers
2
- !pip install torch
3
- !pip install sentencepiece
4
- !pip install gradio
 
 
 
 
 
 
5
 
6
  from transformers.pipelines import pipeline
7
  from transformers.models.auto.modeling_auto import AutoModelForQuestionAnswering
 
1
+ import subprocess
2
+ import sys
3
+
4
+ def install(package):
5
+ subprocess.check_call([sys.executable, "-m", "pip", "install", package])
6
+
7
+ install("transformers")
8
+ install("torch")
9
+ install("sentencepiece")
10
+ install("gradio")
11
 
12
  from transformers.pipelines import pipeline
13
  from transformers.models.auto.modeling_auto import AutoModelForQuestionAnswering