Spaces:
Runtime error
Runtime error
File size: 1,365 Bytes
ab3f69e 991236b ab3f69e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
import streamlit as st
from transformers import AutoModelForCausalLM, AutoTokenizer
MODEL_NAME = "reshinthadith/BashGPTNeo"
def load_model_and_tokenizer(model_name):
"""Adding load_model_and_tokenizer function to keep the model in the memory"""
model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
return tokenizer,model
tokenizer,model = load_model_and_tokenizer(MODEL_NAME)
st.set_page_config(
page_title= "Code Representation Learning",
initial_sidebar_state= "expanded"
)
st.sidebar.title("Code Representation Learning")
workflow = st.sidebar.selectbox('select a task', ['Bash Synthesis'])
if workflow == "Bash Synthesis":
st.title("Program Synthesis for Bash")
arxiv_id = st.text_input("Natural Language prompt ","list all the files in the directory 'data\' ")
output_diction = {}
button = st.button("synthesize")
if button:
link_gen = r"https://arxiv.org/abs/"
webbrowser.open_new_tab(link_gen+str(arxiv_id))
# Abstract
with st.beta_expander("Abstract"):
st.write(output_diction["abstract"])
with st.beta_expander("Influencing Citations"):
st.write(output_diction["influenital_citations"])
with st.beta_expander("Citation Graph"):
print("")
elif workflow == "Rebuttal Analysis":
st.title("Rebuttal Analysis") |