File size: 521 Bytes
c2b24b6
 
 
6d7ebcf
c2b24b6
6d7ebcf
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"""Hugging Face Spaces entrypoint."""

import gradio as gr
import traceback

try:
    from api.main import app as fastapi_app
    ui = gr.Interface(lambda text: text, "text", "text", title="Arabic Sentiment Analysis")
    app = gr.mount_gradio_app(fastapi_app, ui, path="/")
    demo = ui
except Exception as e:
    print("!!! CRITICAL ERROR")
    traceback.print_exc()
    # Create a dummy UI so the container stays alive and lets you read logs
    demo = gr.Interface(lambda: str(e), None, "text", title="Error State")