rahul2001 commited on
Commit
85cbe69
·
1 Parent(s): 967f65c

gradio done

Browse files
Files changed (2) hide show
  1. app.py +21 -9
  2. flagged/log.csv +4 -0
app.py CHANGED
@@ -1,11 +1,23 @@
1
  from src.Pipeline.predict_pipe import Predict_Pipeline
 
 
2
 
3
- if __name__ == "__main__":
4
- obj = Predict_Pipeline()
5
- print(obj.predict(gender = "female",
6
- race_ethnicity="group C",
7
- parental_level_of_education="bachelor's degree",
8
- lunch= "free/reduced",
9
- test_preparation_course="none",
10
- reading_score= 75,
11
- writing_score= 60))
 
 
 
 
 
 
 
 
 
 
 
1
  from src.Pipeline.predict_pipe import Predict_Pipeline
2
+ import gradio as gr
3
+ from src.exception import CustomException
4
 
5
+ obj = Predict_Pipeline()
6
+
7
+ demo = gr.Interface(obj.predict,
8
+ inputs= [
9
+ gr.Radio(["male","female"],label="Gender"),
10
+ gr.Dropdown(['group B' ,'group C' ,'group A' ,'group D' ,'group E'],label="Race"),
11
+ gr.Dropdown(["bachelor's degree" ,'some college' ,"master's degree", "associate's degree",
12
+ 'high school' ,'some high school'],label="Parent Education"),
13
+ gr.Radio(['standard', 'free/reduced'],label="Lunch"),
14
+ gr.Radio(['none', 'completed'],label="Coaching"),
15
+ gr.Slider(0,100,label="writing Score"),
16
+ gr.Slider(0,100,label="reading score")],
17
+ outputs = "number"
18
+ )
19
+
20
+
21
+
22
+ if __name__ == "__main__":
23
+ demo.launch()
flagged/log.csv ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ Gender,Race,Parent Education,Lunch,Coaching,writing Score,reading score,output,flag,username,timestamp
2
+ female,group A,some college,standard,none,70,19,27.75,,,2023-09-16 20:35:47.672461
3
+ Gender,Race,Parent Education,Lunch,Coaching,writing Score,reading score,output,flag,username,timestamp
4
+ female,group A,some college,standard,none,70,19,27.75,,,2023-09-16 20:35:47.672461