halfdevil/d3modocker
0
1import streamlit as st2from resource import *3from proper_main import *4from resource import llm_chain5import time6 7def main():8 st.title("Github Automated Repo Analysis")9 10 # User input11 user_url = st.text_input("Enter the Github URL")12 13 option = st.radio("What you want me to do",["Python Analysis","GPT Evaluation"])14 15 # Generate response16 if st.button("Submit"):17 18 st.text("Please wait Automation is Processing")19 strttime=time.time()20 repos, status = web_scrape(user_url,st)21 22 #task_progress = st.progress(0)23 #task_progress.progress("Tools is taking action please wait")24 if status == 0:25 repo_path = data_cloning(repos,st)26 data_cleaning(repo_path,st)27 query,report_analysis = analyse(st)28 if len(query) == 0:29 st.write("The given User's URL doesnt Contain Python Repository")30 st.experimental_rerun()31 if option == "Python Analysis":32 repo_name,score=self_analysis(report_analysis)33 output="The Complex Repo is "+ str(repo_name)+" Because the Complexity Score is "+str(score)34 #st.write("The Complex Repo is",repo_name," Because the Complexity Score is",score)35 st.text_area("Bot Response:", value=output, height=100)36 time.sleep(15)37 st.experimental_rerun()38 39 elif option == "GPT Evaluation":40 response_gpt = llm_chain([str(query)])41 # Display the response42 st.text_area("Bot Response:", value=response_gpt['text'], height=100)43 elapsed_time = time.time() - strttime44 st.text(f"Execution time: {elapsed_time:.2f} seconds")45 else:46 output = st.empty()47 output.error(f"Error occurred. Please contact the admin {repos}.")48 time.sleep(5)49 st.experimental_rerun()50 51if __name__ == "__main__":52 main()53 54 