NikosKprl commited on
Commit
2b736c7
·
verified ·
1 Parent(s): d3859f5

Update ✨Entity Linking Application✨.py

Browse files
Files changed (1) hide show
  1. ✨Entity Linking Application✨.py +28 -1
✨Entity Linking Application✨.py CHANGED
@@ -18,7 +18,34 @@ from bs4 import BeautifulSoup
18
  from fake_useragent import UserAgent
19
  import requests
20
 
21
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  ua = UserAgent()
23
 
24
  headers = {
 
18
  from fake_useragent import UserAgent
19
  import requests
20
 
21
+ def get_system_resources():
22
+ # Get CPU and memory usage
23
+ cpu_usage = psutil.cpu_percent(interval=1) # CPU usage in percentage
24
+ memory = psutil.virtual_memory() # Memory usage
25
+ memory_usage = memory.percent # Memory usage percentage
26
+ return cpu_usage, memory_usage
27
+
28
+ # Streamlit app layout
29
+ st.title("System Resource Usage Monitor")
30
+
31
+ # Display CPU and memory usage in real-time
32
+ cpu_bar = st.progress(0)
33
+ memory_bar = st.progress(0)
34
+
35
+ while True:
36
+ cpu_usage, memory_usage = get_system_resources()
37
+
38
+ # Update the progress bars with current usage
39
+ cpu_bar.progress(cpu_usage)
40
+ memory_bar.progress(memory_usage)
41
+
42
+ # Display usage as text
43
+ st.write(f"CPU Usage: {cpu_usage}%")
44
+ st.write(f"Memory Usage: {memory_usage}%")
45
+
46
+ # Sleep for a while to avoid overloading the CPU
47
+ time.sleep(1)
48
+
49
  ua = UserAgent()
50
 
51
  headers = {