Spaces:
Sleeping
Sleeping
File size: 838 Bytes
5d0613a 0304edb 2ba4f98 0304edb 3444a36 2ba4f98 90dbc1a 0304edb 90dbc1a 5d0613a 3444a36 5d0613a 3444a36 5d0613a 3444a36 5d0613a |
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 |
import logging
import gradio as gr
from fastapi import FastAPI
from app_gradio_fastapi import routes
from app_gradio_fastapi.helpers.formatters import request_formatter
from app_gradio_fastapi.helpers.session_logger import change_logging
change_logging()
logging.info("creating FastAPI app...")
CUSTOM_GRADIO_PATH = "/"
app = FastAPI(title="logging_app", version="1.0")
app.include_router(routes.router)
logging.info("FastAPI app created, creating gradio app...")
io = gr.Interface(
request_formatter,
inputs=[
gr.Textbox(lines=1, placeholder=10, label="write a number to divide 100 (0 will raise division by zero error)"),
],
outputs=[
gr.Textbox(lines=1, placeholder=None, label="Text Output"),
],
)
app = gr.mount_gradio_app(app, io, path=CUSTOM_GRADIO_PATH)
logging.info("gradio app mounted")
|