File size: 547 Bytes
5cce4db
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
import gradio as gr
import pandas as pd
import sketch
month=[['April 22', 207], ['May 22',209], ['June 22', 211], ['July 22', 190], ['August 22', 194], ['Sept 22', 199], ['Oct 22',187], ['Nov 22', 187], ['Dec 22', 205], ['Jan 23', 210], ['Feb 23', 210], ['March 23', 209]]
df=pd.DataFrame(month,columns= ['Month', 'Max Demand in GW'])
def answer(question):
  out=df.sketch.ask(question,call_display=False)
  return out
demo = gr.Interface(fn=answer, inputs='text',outputs='text',examples=[['which month has the highest max demand']])
demo.launch()