laitkor commited on
Commit
719f9c1
·
verified ·
1 Parent(s): 0a4754d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -7,12 +7,18 @@ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
7
  demo.launch()
8
  '''
9
  import os
 
 
 
 
 
 
 
 
10
  from datasets import load_dataset
11
  from transformers import AutoTokenizer, AutoModel, T5ForConditionalGeneration, T5Tokenizer, GPT2LMHeadModel, GPT2Tokenizer
12
  import faiss
13
  import numpy as np
14
- import pytesseract
15
- from PIL import Image
16
  import gradio as gr
17
 
18
  # Set the tesseract command path
 
7
  demo.launch()
8
  '''
9
  import os
10
+ import subprocess
11
+
12
+ # Run the setup script to install Tesseract
13
+ subprocess.run(["apt-get", "update"])
14
+ subprocess.run(["apt-get", "install", "-y", "tesseract-ocr"])
15
+
16
+ import pytesseract
17
+ from PIL import Image
18
  from datasets import load_dataset
19
  from transformers import AutoTokenizer, AutoModel, T5ForConditionalGeneration, T5Tokenizer, GPT2LMHeadModel, GPT2Tokenizer
20
  import faiss
21
  import numpy as np
 
 
22
  import gradio as gr
23
 
24
  # Set the tesseract command path