hotdogtest / app.py
Edward Tang
testing
5e627cf
raw
history blame
612 Bytes
import streamlit as st
from transformers import AutoProcessor, SeamlessM4Tv2ForTextToText
st.title("Hot Dog? Or Not!?")
processor = AutoProcessor.from_pretrained("facebook/seamless-m4t-v2-large")
model = SeamlessM4Tv2ForTextToText.from_pretrained("facebook/seamless-m4t-v2-large")
text_inputs = processor(text = "Hello, my dog is cute", src_lang="eng", return_tensors="pt")
# from text
output_tokens = model.generate(**text_inputs, tgt_lang="fra")
translated_text_from_text = processor.decode(output_tokens[0].tolist()[0], skip_special_tokens=True)
st.write(translated_text_from_text)
st.write("fool me")