fiona10's picture
Update app.py
e90dece verified
import pickle
import pandas as pd
from recommendation_model import recommendationModel
import gradio as gr
with open('model2.pkl', 'rb') as f:
loaded_model = pickle.load(f)
def runSystem():
inputs = []
loaded_model.data1 = pd.read_csv('final dataset.csv')
loaded_model.main(inputs)
while True:
user_command = input("\n1. Not what you're looking for? Continue adding detail?\n2. Ask other topic\n3. Exit.\n\nEnter your choice: ")
if user_command.lower() == '1':
print("\n")
loaded_model.main(inputs)
elif user_command.lower() == '2':
inputs = []
print("\n")
loaded_model.main(inputs)
elif user_command.lower() == '3':
print("\n*********Thank you for using our service.*********")
break
else:
print("\nPlease type in the correct command.")
# def greet(name):
# return "Hello " + name + "!!"
iface = gr.Interface(fn=runSystem, inputs="text", outputs="text")
iface.launch()