CoolFace
Apppublic

Ifthikar666/PROJECT1

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
app.py31 linesDownload Raw Back to root
1import gradio as gr2from chatbot import ai_chatbot3import json4import os5 6with open(os.path.abspath(os.path.join(os.path.dirname(__file__),"branding.json"))) as f:7    brand_info = json.load(f)['brand']8 9with gr.Blocks(title=brand_info["organizationName"]) as demo:10    gr.HTML(f'''<div style="display:flex; justify-content: center; margin-bottom:20px;">11            <img src="{brand_info["logo"]['title']}" alt="{brand_info['organizationName']}12            Logo" style="height: 100px:">13            </div>''')14 15    gr.ChatInterface(16        fn=ai_chatbot,17        chatbot=gr.Chatbot(height=500,avatar_images=(None, brand_info['chatbot']['avatar']),18        type="messages"),19        title=brand_info["organizationName"],20        description=brand_info["slogan"],21        type="messages",22        examples=[23            ["give python code for fibonocci series"],24            ["give python code for factorial"],25            ["give python code for prime numbers"],26            ["give python code for odd or even numbers"],27        ]28     )29 30if __name__=="__main__":31    demo.launch()