-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
48 lines (38 loc) 路 1.37 KB
/
Copy pathapp.py
File metadata and controls
48 lines (38 loc) 路 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
"""
Main entry point for Hugging Face Spaces deployment.
"""
import os
import logging
from literary_finder.interface.gradio_app_v3 import create_gradio_app_v3
from literary_finder.config import LangSmithConfig
# Configure logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def main():
"""Main entry point for Hugging Face Spaces."""
# Initialize LangSmith tracing for production
LangSmithConfig.setup_tracing("literary-finder-prod")
if LangSmithConfig.is_enabled():
logger.info("馃攳 LangSmith tracing enabled for production monitoring")
else:
logger.info("馃搳 LangSmith tracing disabled (API key not configured)")
# Set production defaults for Hugging Face Spaces
host = "0.0.0.0"
port = 7860
logger.info("馃殌 Starting The Literary Finder for Hugging Face Spaces...")
logger.info(f"馃搷 Server will be available at: http://{host}:{port}")
logger.info("馃摎 Ready to discover literary insights!")
# Create the Gradio app
app = create_gradio_app_v3()
# Launch with Hugging Face Spaces compatible settings
app.launch(
server_name=host,
server_port=port,
share=False, # Hugging Face handles sharing
debug=False,
show_error=True,
quiet=False
)
if __name__ == "__main__":
main()