Spaces:
Runtime error
Runtime error
| import os | |
| import openai | |
| from openai.error import OpenAIError | |
| import datetime | |
| import gradio as gr | |
| import json | |
| from jinja2 import Template | |
| import requests | |
| def set_defaults(request: gr.Request): | |
| if request.username: | |
| print(request.username) | |
| else: | |
| print("No User Name") | |
| return gr.Textbox(value="Default Value") | |
| #Gradio UI | |
| #CIMStheme = gr.themes.Soft().set(button_primary_background_fill='#6562F4',body_background_fill='#e6effc') | |
| CIMStheme = gr.themes.Soft().set(button_primary_background_fill='#6562F4') | |
| with gr.Blocks(CIMStheme) as iface: | |
| with gr.Row(): | |
| with gr.Column(): | |
| gr.Markdown(value="<H2 style='text-align: center;'>NILI - Powered by CIMS.AI</h2>") | |
| with gr.Row(): | |
| with gr.Column(variant='panel'): | |
| question_tbox= gr.components.Textbox(lines=3, placeholder="Enter your question here", label="NIL Question",info="Depending the scope of your question, results may take 30-60 sec.",interactive=True) | |
| with gr.Row(): | |
| with gr.Column(): | |
| gr.Markdown(value="[Ask Questions/Provide Feedback](https://discord.com/channels/1168589934244929647/1168589934244929650)") | |
| with gr.Row(): | |
| with gr.Column(): | |
| gr.HTML('<center><i>© 2023 Collegiate Influencer Marketing Systems, Inc.</i><br>CIMS.AI, CIMS.AI logo, NILI, NILI logo, and EzNIL are trademarks of Collegiate Influencer Marketing Systems, Inc.</center>') | |
| iface.load(fn=set_defaults,outputs=question_tbox) | |
| iface.launch() |