fix: update logger to use spaces.config to check if the space is ZeroGPU
Browse files
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"
|
| 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:
|