dwipper commited on
Commit
3d809f1
·
1 Parent(s): 6df2000

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py CHANGED
@@ -1,4 +1,20 @@
 
 
 
 
1
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  #Gradio UI
4
  #CIMStheme = gr.themes.Soft().set(button_primary_background_fill='#6562F4',body_background_fill='#e6effc')
@@ -8,6 +24,9 @@ with gr.Blocks(CIMStheme) as iface:
8
  with gr.Row():
9
  with gr.Column():
10
  gr.Markdown(value="<H2 style='text-align: center;'>NILI - Powered by CIMS.AI</h2>")
 
 
 
11
  with gr.Row():
12
  with gr.Column():
13
  gr.Markdown(value="[Ask Questions/Provide Feedback](https://discord.com/channels/1168589934244929647/1168589934244929650)")
@@ -15,4 +34,6 @@ with gr.Blocks(CIMStheme) as iface:
15
  with gr.Column():
16
  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>')
17
 
 
 
18
  iface.launch()
 
1
+ import os
2
+ import openai
3
+ from openai.error import OpenAIError
4
+ import datetime
5
  import gradio as gr
6
+ import json
7
+ from jinja2 import Template
8
+ import requests
9
+
10
+ def set_defaults(request: gr.Request):
11
+
12
+ if request.username:
13
+ print(request.username)
14
+ else:
15
+ print("No User Name")
16
+
17
+ return
18
 
19
  #Gradio UI
20
  #CIMStheme = gr.themes.Soft().set(button_primary_background_fill='#6562F4',body_background_fill='#e6effc')
 
24
  with gr.Row():
25
  with gr.Column():
26
  gr.Markdown(value="<H2 style='text-align: center;'>NILI - Powered by CIMS.AI</h2>")
27
+ with gr.Row():
28
+ with gr.Column(variant='panel'):
29
+ 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)
30
  with gr.Row():
31
  with gr.Column():
32
  gr.Markdown(value="[Ask Questions/Provide Feedback](https://discord.com/channels/1168589934244929647/1168589934244929650)")
 
34
  with gr.Column():
35
  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>')
36
 
37
+ iface.load(fn=set_defaults)
38
+
39
  iface.launch()