fiona10 commited on
Commit
bcee71a
1 Parent(s): 78ff455

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -3
app.py CHANGED
@@ -1,7 +1,31 @@
 
 
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  iface.launch()
 
1
+ import pickle
2
+ import pandas as pd
3
  import gradio as gr
4
 
5
+ with open('model2.pkl', 'rb') as f:
6
+ loaded_model = pickle.load(f)
7
 
8
+ def runSystem():
9
+ inputs = []
10
+ loaded_model.data1 = pd.read_csv('final dataset.csv')
11
+ loaded_model.main(inputs)
12
+ while True:
13
+ user_command = input("\n1. Not what you're looking for? Continue adding detail?\n2. Ask other topic\n3. Exit.\n\nEnter your choice: ")
14
+ if user_command.lower() == '1':
15
+ print("\n")
16
+ loaded_model.main(inputs)
17
+ elif user_command.lower() == '2':
18
+ inputs = []
19
+ print("\n")
20
+ loaded_model.main(inputs)
21
+ elif user_command.lower() == '3':
22
+ print("\n*********Thank you for using our service.*********")
23
+ break
24
+ else:
25
+ print("\nPlease type in the correct command.")
26
+
27
+ # def greet(name):
28
+ # return "Hello " + name + "!!"
29
+
30
+ iface = gr.Interface(fn=runSystem, inputs="text", outputs="text")
31
  iface.launch()