yukiapple323's picture
Create app.py
1005f0c verified
raw
history blame
739 Bytes
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()