Chenglu-She commited on
Commit
c8b13b5
1 Parent(s): e5bab95

Upload folder using huggingface_hub

Browse files
README.md CHANGED
@@ -2,8 +2,8 @@
2
  ---
3
  tags: [gradio-custom-component,gradio-template-SimpleTextbox,log,gradio_log,gradio_log_component,gradio_print_log]
4
  title: gradio_log V0.0.2
5
- colorFrom: pink
6
- colorTo: purple
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
 
2
  ---
3
  tags: [gradio-custom-component,gradio-template-SimpleTextbox,log,gradio_log,gradio_log_component,gradio_print_log]
4
  title: gradio_log V0.0.2
5
+ colorFrom: gray
6
+ colorTo: gray
7
  sdk: docker
8
  pinned: false
9
  license: apache-2.0
__pycache__/app.cpython-311.pyc CHANGED
Binary files a/__pycache__/app.cpython-311.pyc and b/__pycache__/app.cpython-311.pyc differ
 
app.py CHANGED
@@ -35,21 +35,20 @@ class CustomFormatter(logging.Formatter):
35
  formatter = CustomFormatter()
36
 
37
  log_file = tempfile.mktemp(suffix=".log")
 
38
 
39
  ch = logging.FileHandler(log_file)
40
  ch.setLevel(logging.DEBUG)
41
  ch.setFormatter(formatter)
42
 
43
- logger = logging.getLogger()
44
  logger.setLevel(logging.DEBUG)
45
  for handler in logger.handlers:
46
  logger.removeHandler(handler)
47
  logger.addHandler(ch)
48
 
49
 
50
- logger.info(
51
- "Use the left column to log messages to a file, and the log will be displayed in here."
52
- )
53
 
54
 
55
  def create_log_handler(level):
@@ -60,8 +59,6 @@ def create_log_handler(level):
60
  return l
61
 
62
 
63
- Path(log_file).touch()
64
-
65
  with gr.Blocks() as demo:
66
  text = gr.Textbox(label="Enter text to write to log file")
67
  with gr.Row():
 
35
  formatter = CustomFormatter()
36
 
37
  log_file = tempfile.mktemp(suffix=".log")
38
+ Path(log_file).touch()
39
 
40
  ch = logging.FileHandler(log_file)
41
  ch.setLevel(logging.DEBUG)
42
  ch.setFormatter(formatter)
43
 
44
+ logger = logging.getLogger("gradio_log")
45
  logger.setLevel(logging.DEBUG)
46
  for handler in logger.handlers:
47
  logger.removeHandler(handler)
48
  logger.addHandler(ch)
49
 
50
 
51
+ logger.info("The logs will be displayed in here.")
 
 
52
 
53
 
54
  def create_log_handler(level):
 
59
  return l
60
 
61
 
 
 
62
  with gr.Blocks() as demo:
63
  text = gr.Textbox(label="Enter text to write to log file")
64
  with gr.Row():
space.py CHANGED
@@ -75,21 +75,20 @@ class CustomFormatter(logging.Formatter):
75
  formatter = CustomFormatter()
76
 
77
  log_file = tempfile.mktemp(suffix=".log")
 
78
 
79
  ch = logging.FileHandler(log_file)
80
  ch.setLevel(logging.DEBUG)
81
  ch.setFormatter(formatter)
82
 
83
- logger = logging.getLogger()
84
  logger.setLevel(logging.DEBUG)
85
  for handler in logger.handlers:
86
  logger.removeHandler(handler)
87
  logger.addHandler(ch)
88
 
89
 
90
- logger.info(
91
- "Use the left column to log messages to a file, and the log will be displayed in here."
92
- )
93
 
94
 
95
  def create_log_handler(level):
@@ -100,8 +99,6 @@ def create_log_handler(level):
100
  return l
101
 
102
 
103
- Path(log_file).touch()
104
-
105
  with gr.Blocks() as demo:
106
  text = gr.Textbox(label="Enter text to write to log file")
107
  with gr.Row():
 
75
  formatter = CustomFormatter()
76
 
77
  log_file = tempfile.mktemp(suffix=".log")
78
+ Path(log_file).touch()
79
 
80
  ch = logging.FileHandler(log_file)
81
  ch.setLevel(logging.DEBUG)
82
  ch.setFormatter(formatter)
83
 
84
+ logger = logging.getLogger("gradio_log")
85
  logger.setLevel(logging.DEBUG)
86
  for handler in logger.handlers:
87
  logger.removeHandler(handler)
88
  logger.addHandler(ch)
89
 
90
 
91
+ logger.info("The logs will be displayed in here.")
 
 
92
 
93
 
94
  def create_log_handler(level):
 
99
  return l
100
 
101
 
 
 
102
  with gr.Blocks() as demo:
103
  text = gr.Textbox(label="Enter text to write to log file")
104
  with gr.Row():
src/README.md CHANGED
@@ -50,21 +50,20 @@ class CustomFormatter(logging.Formatter):
50
  formatter = CustomFormatter()
51
 
52
  log_file = tempfile.mktemp(suffix=".log")
 
53
 
54
  ch = logging.FileHandler(log_file)
55
  ch.setLevel(logging.DEBUG)
56
  ch.setFormatter(formatter)
57
 
58
- logger = logging.getLogger()
59
  logger.setLevel(logging.DEBUG)
60
  for handler in logger.handlers:
61
  logger.removeHandler(handler)
62
  logger.addHandler(ch)
63
 
64
 
65
- logger.info(
66
- "Use the left column to log messages to a file, and the log will be displayed in here."
67
- )
68
 
69
 
70
  def create_log_handler(level):
@@ -75,8 +74,6 @@ def create_log_handler(level):
75
  return l
76
 
77
 
78
- Path(log_file).touch()
79
-
80
  with gr.Blocks() as demo:
81
  text = gr.Textbox(label="Enter text to write to log file")
82
  with gr.Row():
 
50
  formatter = CustomFormatter()
51
 
52
  log_file = tempfile.mktemp(suffix=".log")
53
+ Path(log_file).touch()
54
 
55
  ch = logging.FileHandler(log_file)
56
  ch.setLevel(logging.DEBUG)
57
  ch.setFormatter(formatter)
58
 
59
+ logger = logging.getLogger("gradio_log")
60
  logger.setLevel(logging.DEBUG)
61
  for handler in logger.handlers:
62
  logger.removeHandler(handler)
63
  logger.addHandler(ch)
64
 
65
 
66
+ logger.info("The logs will be displayed in here.")
 
 
67
 
68
 
69
  def create_log_handler(level):
 
74
  return l
75
 
76
 
 
 
77
  with gr.Blocks() as demo:
78
  text = gr.Textbox(label="Enter text to write to log file")
79
  with gr.Row():
src/demo/app.py CHANGED
@@ -35,21 +35,20 @@ class CustomFormatter(logging.Formatter):
35
  formatter = CustomFormatter()
36
 
37
  log_file = tempfile.mktemp(suffix=".log")
 
38
 
39
  ch = logging.FileHandler(log_file)
40
  ch.setLevel(logging.DEBUG)
41
  ch.setFormatter(formatter)
42
 
43
- logger = logging.getLogger()
44
  logger.setLevel(logging.DEBUG)
45
  for handler in logger.handlers:
46
  logger.removeHandler(handler)
47
  logger.addHandler(ch)
48
 
49
 
50
- logger.info(
51
- "Use the left column to log messages to a file, and the log will be displayed in here."
52
- )
53
 
54
 
55
  def create_log_handler(level):
@@ -60,8 +59,6 @@ def create_log_handler(level):
60
  return l
61
 
62
 
63
- Path(log_file).touch()
64
-
65
  with gr.Blocks() as demo:
66
  text = gr.Textbox(label="Enter text to write to log file")
67
  with gr.Row():
 
35
  formatter = CustomFormatter()
36
 
37
  log_file = tempfile.mktemp(suffix=".log")
38
+ Path(log_file).touch()
39
 
40
  ch = logging.FileHandler(log_file)
41
  ch.setLevel(logging.DEBUG)
42
  ch.setFormatter(formatter)
43
 
44
+ logger = logging.getLogger("gradio_log")
45
  logger.setLevel(logging.DEBUG)
46
  for handler in logger.handlers:
47
  logger.removeHandler(handler)
48
  logger.addHandler(ch)
49
 
50
 
51
+ logger.info("The logs will be displayed in here.")
 
 
52
 
53
 
54
  def create_log_handler(level):
 
59
  return l
60
 
61
 
 
 
62
  with gr.Blocks() as demo:
63
  text = gr.Textbox(label="Enter text to write to log file")
64
  with gr.Row():
src/demo/space.py CHANGED
@@ -75,21 +75,20 @@ class CustomFormatter(logging.Formatter):
75
  formatter = CustomFormatter()
76
 
77
  log_file = tempfile.mktemp(suffix=".log")
 
78
 
79
  ch = logging.FileHandler(log_file)
80
  ch.setLevel(logging.DEBUG)
81
  ch.setFormatter(formatter)
82
 
83
- logger = logging.getLogger()
84
  logger.setLevel(logging.DEBUG)
85
  for handler in logger.handlers:
86
  logger.removeHandler(handler)
87
  logger.addHandler(ch)
88
 
89
 
90
- logger.info(
91
- "Use the left column to log messages to a file, and the log will be displayed in here."
92
- )
93
 
94
 
95
  def create_log_handler(level):
@@ -100,8 +99,6 @@ def create_log_handler(level):
100
  return l
101
 
102
 
103
- Path(log_file).touch()
104
-
105
  with gr.Blocks() as demo:
106
  text = gr.Textbox(label="Enter text to write to log file")
107
  with gr.Row():
 
75
  formatter = CustomFormatter()
76
 
77
  log_file = tempfile.mktemp(suffix=".log")
78
+ Path(log_file).touch()
79
 
80
  ch = logging.FileHandler(log_file)
81
  ch.setLevel(logging.DEBUG)
82
  ch.setFormatter(formatter)
83
 
84
+ logger = logging.getLogger("gradio_log")
85
  logger.setLevel(logging.DEBUG)
86
  for handler in logger.handlers:
87
  logger.removeHandler(handler)
88
  logger.addHandler(ch)
89
 
90
 
91
+ logger.info("The logs will be displayed in here.")
 
 
92
 
93
 
94
  def create_log_handler(level):
 
99
  return l
100
 
101
 
 
 
102
  with gr.Blocks() as demo:
103
  text = gr.Textbox(label="Enter text to write to log file")
104
  with gr.Row():