samanjoy2 commited on
Commit
b7d8ebc
1 Parent(s): 8e03db3

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +22 -0
  2. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+ import torch
4
+
5
+ # Load the text-to-text generation pipeline
6
+ pipe = pipeline("text2text-generation", model="samanjoy2/bn2ipa_TwoBraincells", device='cpu')
7
+
8
+ st.title("Bangla Text to IPA Transcription")
9
+
10
+ # User input for text generation
11
+ input_text = st.text_area("Enter Bangla text for IPA Transcription:", max_chars=400)
12
+
13
+ if st.button("Generate IPA"):
14
+ if input_text:
15
+ # Generate text using the pipeline
16
+ generated_text = pipe(input_text, max_length=512, batch_size=1)[0]['generated_text']
17
+
18
+ # Display the generated text
19
+ st.subheader("Generated IPA:")
20
+ st.write(generated_text)
21
+ else:
22
+ st.warning("Please enter text for generation.")
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ streamlit
2
+ transformers
3
+ torch