Spaces:
Runtime error
Runtime error
User specified username, repo, and file type selector. Need to deal with access token
Browse files10 unmodified lines111213141514171516171811 unmodified lines303132333435363738394041424344455 unmodified lines51525354555657581 unmodified line606162536364656610 unmodified lines
#get the GITHUB_ACCESS_TOKEN from the .env fileGITHUB_ACCESS_TOKEN = os.getenv("GITHUB_ACCESS_TOKEN")USER = "heaversm"REPO = "gdrive-docker"GITHUB_BASE_URL = "https://github.com/"FILE_TYPES_TO_LOAD = (".py", ".ts")
@st.cache_resourcedef get_hugging_face_model():11 unmodified lines
st.title("Find Similar Code")
#streamlit text input for USERUSER = st.text_input("Enter the Github User", value = "heaversm")#streamlit text input for REPOREPO = st.text_input("Enter the Github Repository", value = "gdrive-docker")
#streamlit file type selectorFILE_TYPES_TO_LOAD = st.multiselect("Select File Types", [".py", ".ts",".js",".css",".html"], default = [".py"])
text_input = st.text_area("Enter a Code Example", value ="""def create_app():5 unmodified lines)
button = st.button("Find Similar Code")
if button: loader = GithubFileLoader( #repo is USER/REPO1 unmodified line access_token=GITHUB_ACCESS_TOKEN, github_api_url="https://api.github.com", file_filter=lambda file_path: file_path.endswith( FILE_TYPES_TO_LOAD tuple(FILE_TYPES_TO_LOAD) ) ) documents = loader.load()github_st.py+14-4