Spaces:
Sleeping
Sleeping
import subprocess | |
import torch | |
import streamlit as st | |
from streamlit import session_state as state | |
import streamlit_ace | |
import model | |
import pipline | |
if "app" not in state: | |
state.app = "model" | |
# state.input_text = "This is the input text." | |
# state.word = "input" | |
state.out = "" | |
st.title("Streamlit using Huggingface Transformers and langchain") | |
def __run_pipline(): | |
st.text(f"input_text: {state.input_text}\nword: {state.word}") | |
st.markdown(":green[Running pipline]") | |
st.text(pipline.pipeline(state.input_text, state.word)) | |
def __run_model(): | |
st.text(f"input_text: {state.input_text}") | |
st.markdown(":green[Running model]") | |
st.text(model.run(state.input_text)) | |
st.text_area("input_text", key="input_text") | |
st.text_input("word", key="word") | |
st.button("pip line", on_click=__run_pipline) | |
st.button("model", on_click=__run_model) |