24Sureshkumar commited on
Commit
56cd428
·
verified ·
1 Parent(s): ee80725

Delete app_ui.py

Browse files
Files changed (1) hide show
  1. app_ui.py +0 -41
app_ui.py DELETED
@@ -1,41 +0,0 @@
1
- # app_ui.py
2
- import streamlit as st
3
- from app import translate_tamil_to_english, generate_image, generate_creative_text
4
- from PIL import Image
5
-
6
- st.set_page_config(page_title="Tamil → English + AI Art", layout="centered")
7
- st.title("🧠 Tamil to English + AI Image + Text Generator")
8
-
9
- tamil_input = st.text_area("✍️ Enter Tamil Text", height=150)
10
- reference_translation = st.text_input("📘 (Optional) Reference English Translation for ROUGE", "")
11
-
12
- if st.button("✨ Generate Everything"):
13
- if not tamil_input.strip():
14
- st.warning("Please enter Tamil text to proceed.")
15
- else:
16
- with st.spinner("Translating..."):
17
- trans, t_time, rouge_l = translate_tamil_to_english(tamil_input, reference_translation.strip())
18
- st.success(f"✅ Translation done in {t_time}s")
19
- st.markdown(f"**Translated English:** `{trans}`")
20
-
21
- if rouge_l is not None:
22
- st.markdown(f"📊 **ROUGE-L Score:** `{rouge_l}`")
23
- else:
24
- st.info("ℹ️ No reference provided—ROUGE-L not calculated.")
25
-
26
- with st.spinner("🎨 Generating AI image..."):
27
- img_path, img_time = generate_image(trans)
28
- if img_path:
29
- st.success(f"✅ Image generated in {img_time}s")
30
- st.image(Image.open(img_path), caption="🖼️ AI Generated", use_column_width=True)
31
- else:
32
- st.error(img_time)
33
-
34
- with st.spinner("💡 Generating creative text..."):
35
- craft, c_time, tokens, rpt = generate_creative_text(trans)
36
- st.success(f"✅ Generated in {c_time}s")
37
- st.markdown(f"**Creative Text:** `{craft}`")
38
- st.markdown(f"ℹ️ Tokens: {tokens}, Repetition Rate: {rpt}")
39
-
40
- st.markdown("---")
41
- st.markdown("Made with ❤️ using Streamlit, MBart, GPT‑2 & Stable Diffusion 2.1")