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