File size: 739 Bytes
1005f0c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
pip install torch torchvision torchaudio gradio transformers

import gradio as gr
from transformers import AutoTokenizer, AutoModel

# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("team-lucid/trocr-small-korean")
model = AutoModel.from_pretrained("team-lucid/trocr-small-korean")

def read_html_file():
    with open("index.html", 'r', encoding='utf-8') as f:
        html_string = f.read()
    return html_string

def scan_candy_label():
    html_content = read_html_file()
    return html_content

title = "Candy Label Scanner"
description = "A web app to scan and display candy labels."

iface = gr.Interface(fn=scan_candy_label, inputs=[], outputs="html", title=title, description=description)
iface.launch()