Spaces:
Runtime error
Runtime error
File size: 1,033 Bytes
bcee71a e90dece 3100f13 bcee71a 3100f13 bcee71a 3100f13 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
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() |