Trung
update
4cef5cf
import gradio as gr
import os
HF_TOKEN = os.environ.get("HF_TOKEN")
def main():
# Your private space ID
PRIVATE_SPACE_ID = "okeysir/tts-sync-prototype-backend"
# Create a header for your public app
with gr.Blocks() as demo:
# Load from private space using the correct syntax
try:
app = gr.load(
name=PRIVATE_SPACE_ID,
src="spaces",
token=HF_TOKEN
)
# Embed the loaded app
except Exception as e:
gr.Markdown(f"""
## Error loading application
There was an error connecting to the backend service. This could be due to:
- The backend service is not running
- Authentication issues with the private space
- Network connectivity problems
Please contact the administrator if this problem persists.
""")
gr.Markdown(f"Technical details (for administrators): {str(e)}")
# Launch the app
demo.launch()
if __name__ == "__main__":
main()