thedamn commited on
Commit
fb25cb2
·
1 Parent(s): b5f678c

default app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -44
app.py CHANGED
@@ -1,57 +1,50 @@
1
  import streamlit as st
2
  from resource import *
3
  from proper_main import *
4
- #from resource import llm_chain
5
  import time
6
- import random
7
 
8
  def main():
9
- while True:
10
-
11
- st.title("Github Automated Repo Analysis")
12
 
13
- # User input
14
- user_url = st.text_input("Enter the Github URL",key=str(random.randrange(1,100)))
15
-
16
- option = st.radio("What you want me to do",["Python Analysis","GPT Evaluation"],key=str(random.randrange(1,100)))
17
 
18
- # Generate response
19
- if st.button("Submit",key=str(random.randrange(1,100))):
20
 
21
- st.text("Please wait Automation is Processing",key=str(random.randrange(1,100)))
22
- strttime=time.time()
23
- repos, status = web_scrape(user_url,st)
24
-
25
- #task_progress = st.progress(0)
26
- #task_progress.progress("Tools is taking action please wait")
27
- if status == 0:
28
- repo_path = data_cloning(repos,st)
29
- data_cleaning(repo_path,st)
30
- query,report_analysis = analyse(st)
31
- if len(query) == 0:
32
- st.write("The given User's URL doesnt Contain Python Repository",key=str(random.randrange(1,100)))
33
- break
34
- if option == "Python Analysis":
35
- repo_name,score=self_analysis(report_analysis)
36
- output="The Complex Repo is "+ str(repo_name)+" Because the Complexity Score is "+str(score)
37
- #st.write("The Complex Repo is",repo_name," Because the Complexity Score is",score)
38
- st.text_area("Bot Response:", value=output, height=100,key=str(random.randrange(1,100)))
39
- time.sleep(15)
40
- break
41
-
42
- elif option == "GPT Evaluation":
43
- response_gpt = llm_chain([str(query)])
44
- # Display the response
45
- st.text_area("Bot Response:", value=response_gpt['text'], height=100,key=str(random.randrange(1,100)))
46
- elapsed_time = time.time() - strttime
47
- st.text(f"Execution time: {elapsed_time:.2f} seconds",key=str(random.randrange(1,100)))
48
- else:
49
- output = st.empty()
50
- output.error(f"Error occurred. Please contact the admin {repos}.")
51
- time.sleep(5)
52
- break
53
 
54
  if __name__ == "__main__":
55
  main()
56
 
57
-
 
1
  import streamlit as st
2
  from resource import *
3
  from proper_main import *
4
+ from resource import llm_chain
5
  import time
 
6
 
7
  def main():
8
+ st.title("Github Automated Repo Analysis")
 
 
9
 
10
+ # User input
11
+ 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 response
16
+ 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
+ if option == "Python Analysis":
31
+ repo_name,score=self_analysis(report_analysis)
32
+ output="The Complex Repo is "+ str(repo_name)+" Because the Complexity Score is "+str(score)
33
+ #st.write("The Complex Repo is",repo_name," Because the Complexity Score is",score)
34
+ st.text_area("Bot Response:", value=output, height=100)
35
+ time.sleep(15)
36
+
37
+ elif option == "GPT Evaluation":
38
+ response_gpt = llm_chain([str(query)])
39
+ # Display the response
40
+ st.text_area("Bot Response:", value=response_gpt['text'], height=100)
41
+ elapsed_time = time.time() - strttime
42
+ st.text(f"Execution time: {elapsed_time:.2f} seconds")
43
+ else:
44
+ output = st.empty()
45
+ output.error(f"Error occurred. Please contact the admin {repos}.")
46
+ time.sleep(5)
 
 
 
47
 
48
  if __name__ == "__main__":
49
  main()
50