Update app.py
Browse files
app.py
CHANGED
|
@@ -1,23 +1,16 @@
|
|
| 1 |
-
pip install torch torchvision torchaudio
|
| 2 |
|
| 3 |
-
import
|
| 4 |
-
|
| 5 |
|
| 6 |
-
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained("team-lucid/trocr-small-korean")
|
| 8 |
model = AutoModel.from_pretrained("team-lucid/trocr-small-korean")
|
| 9 |
|
| 10 |
-
|
| 11 |
-
with open("index.html", 'r', encoding='utf-8') as f:
|
| 12 |
-
html_string = f.read()
|
| 13 |
-
return html_string
|
| 14 |
-
|
| 15 |
-
def scan_candy_label():
|
| 16 |
-
html_content = read_html_file()
|
| 17 |
-
return html_content
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
iface.launch()
|
|
|
|
| 1 |
+
pip install torch torchvision torchaudio
|
| 2 |
|
| 3 |
+
import streamlit as st
|
| 4 |
+
import streamlit.components.v1 as components
|
| 5 |
|
| 6 |
+
from transformers import AutoTokenizer, AutoModel
|
| 7 |
tokenizer = AutoTokenizer.from_pretrained("team-lucid/trocr-small-korean")
|
| 8 |
model = AutoModel.from_pretrained("team-lucid/trocr-small-korean")
|
| 9 |
|
| 10 |
+
st.title("Candy Label Scanner")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
+
# Embed the HTML file in the Streamlit app
|
| 13 |
+
with open("index.html", 'r', encoding='utf-8') as f:
|
| 14 |
+
html_string = f.read()
|
| 15 |
|
| 16 |
+
components.html(html_string, height=800, scrolling=True)
|
|
|