Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,11 +18,13 @@ assert (
|
|
18 |
__version__ == "4.32.0"
|
19 |
), "Please use transformers version 4.32.0, pip install transformers==4.32.0"
|
20 |
|
|
|
21 |
reader = easyocr.Reader(
|
22 |
["en"],
|
23 |
gpu=False
|
24 |
) # this needs to run only once to load the model into memory
|
25 |
|
|
|
26 |
|
27 |
def get_easy_text(img_file):
|
28 |
out = reader.readtext(img_file, detail=0, paragraph=True)
|
@@ -43,6 +45,7 @@ model = (
|
|
43 |
.half()
|
44 |
)
|
45 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
|
|
46 |
generation_config = GenerationConfig.from_dict(
|
47 |
{
|
48 |
"chat_format": "chatml",
|
|
|
18 |
__version__ == "4.32.0"
|
19 |
), "Please use transformers version 4.32.0, pip install transformers==4.32.0"
|
20 |
|
21 |
+
print("=== init OCR engine===")
|
22 |
reader = easyocr.Reader(
|
23 |
["en"],
|
24 |
gpu=False
|
25 |
) # this needs to run only once to load the model into memory
|
26 |
|
27 |
+
print("=== Success, Now the Captioner VLM===")
|
28 |
|
29 |
def get_easy_text(img_file):
|
30 |
out = reader.readtext(img_file, detail=0, paragraph=True)
|
|
|
45 |
.half()
|
46 |
)
|
47 |
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
48 |
+
print("=== Success, Now serving===")
|
49 |
generation_config = GenerationConfig.from_dict(
|
50 |
{
|
51 |
"chat_format": "chatml",
|