ryomo commited on
Commit
0d8e8db
·
1 Parent(s): 0300eff

fix: update logger to use spaces.config to check if the space is ZeroGPU

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -7,13 +7,14 @@ sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
7
  import logging
8
 
9
  import gradio as gr
 
10
 
11
  from unpredictable_lord.chat import chat_with_llm_stream
12
 
13
  logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
14
  logger = logging.getLogger(__name__)
15
 
16
- logger.info(f"ZERO_GPU: {os.environ.get('ZERO_GPU')}")
17
 
18
  # Gradio UI
19
  with gr.Blocks(title="Unpredictable Lord") as demo:
 
7
  import logging
8
 
9
  import gradio as gr
10
+ import spaces
11
 
12
  from unpredictable_lord.chat import chat_with_llm_stream
13
 
14
  logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
15
  logger = logging.getLogger(__name__)
16
 
17
+ logger.info(f"ZeroGPU: {spaces.config.Config.zero_gpu}")
18
 
19
  # Gradio UI
20
  with gr.Blocks(title="Unpredictable Lord") as demo: