HuuDatLego commited on
Commit
8f16eeb
·
verified ·
1 Parent(s): 5358c7e

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. README.md +28 -0
  2. scripts/monitor-logs.sh +21 -0
README.md CHANGED
@@ -19,3 +19,31 @@ Dự án học tập trực tuyến hỗ trợ biên dịch và thực thi mã n
19
  - **Giao diện**: Sử dụng EJS Templates và Express.js.
20
 
21
  Kiểm tra tham khảo cấu hình tại: [Spaces Config Reference](https://huggingface.co/docs/hub/spaces-config-reference)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  - **Giao diện**: Sử dụng EJS Templates và Express.js.
20
 
21
  Kiểm tra tham khảo cấu hình tại: [Spaces Config Reference](https://huggingface.co/docs/hub/spaces-config-reference)
22
+
23
+ ## Monitoring and Troubleshooting
24
+
25
+ Để kiểm tra lỗi và theo dõi logs trên Hugging Face Spaces, bạn có thể sử dụng các lệnh sau (yêu cầu cài đặt `curl` và có `HF_TOKEN`):
26
+
27
+ ### Container Logs (Runtime)
28
+ ```bash
29
+ curl -N \
30
+ -H "Authorization: Bearer $HF_TOKEN" \
31
+ "https://huggingface.co/api/spaces/HuuDatLego/Unicode/logs/run"
32
+ ```
33
+
34
+ ### Build Logs
35
+ ```bash
36
+ curl -N \
37
+ -H "Authorization: Bearer $HF_TOKEN" \
38
+ "https://huggingface.co/api/spaces/HuuDatLego/Unicode/logs/build"
39
+ ```
40
+
41
+ Hoặc sử dụng script hỗ trợ:
42
+ ```bash
43
+ # Cấp quyền thực thi
44
+ chmod +x scripts/monitor-logs.sh
45
+
46
+ # Chạy theo dõi
47
+ ./scripts/monitor-logs.sh build # Theo dõi quá trình build
48
+ ./scripts/monitor-logs.sh run # Theo dõi runtime logs
49
+ ```
scripts/monitor-logs.sh ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Script to monitor Hugging Face Space logs
4
+ # Usage: ./monitor-logs.sh [run|build]
5
+
6
+ TYPE=${1:-run}
7
+
8
+ if [ "$TYPE" != "run" ] && [ "$TYPE" != "build" ]; then
9
+ echo "Usage: $0 [run|build]"
10
+ exit 1
11
+ fi
12
+
13
+ if [ -z "$HF_TOKEN" ]; then
14
+ echo "Warning: HF_TOKEN is not set. Authorization may fail if the Space is private."
15
+ fi
16
+
17
+ echo "Streaming $TYPE logs for HuuDatLego/Unicode..."
18
+
19
+ curl -N \
20
+ -H "Authorization: Bearer $HF_TOKEN" \
21
+ "https://huggingface.co/api/spaces/HuuDatLego/Unicode/logs/$TYPE"