-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathapp.py
More file actions
43 lines (34 loc) 路 1.4 KB
/
Copy pathapp.py
File metadata and controls
43 lines (34 loc) 路 1.4 KB
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
37
38
39
40
41
42
43
import streamlit as st
import os
from analyzer import analyze_logs
st.set_page_config(page_title="Colibri Offline Analyzer", page_icon="馃惁", layout="centered")
st.markdown("""
<div style='text-align: center'>
<h1>馃惁 Colibri Offline Analyzer</h1>
<p><i>Powered by the Colibr矛 GLM-5.2 local runtime</i></p>
</div>
""", unsafe_allow_html=True)
st.write("Upload your proprietary application logs below. They never leave your machine.")
uploaded_file = st.file_uploader("Upload Log File (.txt, .log)", type=["txt", "log"])
sample_button = st.button("Use Sample Log")
log_content = ""
if uploaded_file is not None:
log_content = uploaded_file.read().decode("utf-8")
elif sample_button:
try:
with open("sample_log.txt", "r") as f:
log_content = f.read()
except Exception:
st.warning("sample_log.txt not found.")
if log_content:
with st.expander("View Raw Logs"):
st.code(log_content, language="log")
if st.button("馃攳 Analyze with GLM-5.2", type="primary"):
with st.spinner("Analyzing securely offline..."):
result = analyze_logs(log_content)
st.success("Analysis Complete!")
st.markdown("### Report")
st.markdown(result)
with open("outputs.md", "w", encoding="utf-8") as f:
f.write(result)
st.info("Report automatically saved to outputs.md")