Download app.py from janggi3/ragDumm: direct link, hf CLI and curl.
- Browser
- Download file 875 Bytes
-
https://huggingface.co/spaces/janggi3/ragDumm/resolve/main/app.py
- Command line
-
hf download hf://spaces/janggi3/ragDumm/app.py
-
curl -L -o app.py https://huggingface.co/spaces/janggi3/ragDumm/resolve/main/app.py
875 Bytes
| import sys | |
| import os | |
| import logging | |
| sys.path.insert(0, os.path.dirname(__file__)) | |
| from dotenv import load_dotenv | |
| load_dotenv(os.path.join(os.path.dirname(__file__), ".env")) | |
| # Suppress OTel "Failed to detach context" warning caused by generator/context interaction. | |
| # Tracing is unaffected. | |
| # Known bug: https://github.com/open-telemetry/opentelemetry-python/issues/2606 | |
| class _SuppressOtelDetachWarning(logging.Filter): | |
| def filter(self, record): | |
| return "Failed to detach context" not in record.getMessage() | |
| logging.getLogger("opentelemetry.context").addFilter(_SuppressOtelDetachWarning()) | |
| from ui.css import custom_css | |
| from ui.gradio_app import create_gradio_ui | |
| if __name__ == "__main__": | |
| print("\n🔨 Creating RAG Assistant...") | |
| demo = create_gradio_ui() | |
| print("\n🚀 Launching RAG Assistant...") | |
| demo.launch(share=True, css=custom_css) |