Ammar-alhaj-ali commited on
Commit
06d7744
1 Parent(s): 516efab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -1,7 +1,17 @@
1
  import os
2
 
 
 
 
 
3
  os.system('pip install torch==1.8.0+cu101 torchvision==0.9.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html')
4
- os.system('pip install -q git+https://github.com/huggingface/transformers.git')
 
 
 
 
 
 
5
 
6
  import gradio as gr
7
  import torch
 
1
  import os
2
 
3
+ import os
4
+ os.system('pip install git+https://github.com/huggingface/transformers.git --upgrade')
5
+ os.system('pip install pyyaml==5.1')
6
+ # workaround: install old version of pytorch since detectron2 hasn't released packages for pytorch 1.9 (issue: https://github.com/facebookresearch/detectron2/issues/3158)
7
  os.system('pip install torch==1.8.0+cu101 torchvision==0.9.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html')
8
+
9
+ # install detectron2 that matches pytorch 1.8
10
+ # See https://detectron2.readthedocs.io/tutorials/install.html for instructions
11
+ #os.system('pip install -q detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cu101/torch1.8/index.html')
12
+
13
+ ## install PyTesseract
14
+ os.system('pip install -q pytesseract')
15
 
16
  import gradio as gr
17
  import torch