aaronmat1905 commited on
Commit
f906c30
1 Parent(s): 64705ab
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -12,8 +12,8 @@ dataset_file = os.listdir(path)[0]
12
  path = os.path.join(path, dataset_file)
13
 
14
  # Configure Google Gemini API
15
- # gemapi = os.getenv("GeminiApi")
16
- gemapi = "AIzaSyAmDOBWfGuEju0oZyUIcn_H0k8XW0cTP7k"
17
  genai.configure(api_key=gemapi)
18
 
19
  # Load the dataset
@@ -92,10 +92,20 @@ html_content = """
92
  </div>
93
  """
94
 
95
- # Create a Gradio interface
96
  with gr.Blocks() as demo:
97
- gr.HTML(html_content)
98
- chatbot = gr.ChatInterface(fn=gradio_chat)
 
 
 
 
 
 
 
 
 
 
 
99
 
100
- # Launch the interface
101
  demo.launch()
 
12
  path = os.path.join(path, dataset_file)
13
 
14
  # Configure Google Gemini API
15
+ gemapi = os.getenv("GeminiApi")
16
+
17
  genai.configure(api_key=gemapi)
18
 
19
  # Load the dataset
 
92
  </div>
93
  """
94
 
 
95
  with gr.Blocks() as demo:
96
+ with gr.Row():
97
+ # Left column with chatbot
98
+ with gr.Column(scale=2):
99
+ gr.HTML(html_content)
100
+ chatbot = gr.Chatbot()
101
+ user_input = gr.Textbox(placeholder="Enter your message here...")
102
+ chat_history = gr.State([])
103
+ submit_btn = gr.Button("Submit")
104
+ submit_btn.click(gradio_chat, inputs=[user_input, chat_history], outputs=[chatbot, chat_history])
105
+
106
+ # Right column with dataframe
107
+ with gr.Column(scale=1):
108
+ gr.Dataframe(value=data, datatype="auto")
109
 
110
+ # Launch the Gradio interface
111
  demo.launch()