Spaces:
Runtime error
Runtime error
Update app.py
Browse files1 unmodified line2345671 unmodified line910111213141516171819202122232425261 unmodified lineimport gradio as grimport osimport json# Set your API keypalm.configure(api_key=os.environ['PALM_KEY'])1 unmodified line# Select the PaLM 2 model# model = 'models/text-bison-001'def responsenew(data):response = palm.chat(messages=data)if "payment" in response.last:respo = {"message": "Click the button below to view premium services and recharge options: ","action": "payment","function": "nothing"}elif "friends" in response.last:respo = {"message": "Click the option below to view list of your friends: ","action": "show_friends","function": "nothing"}1 unmodified line23456781 unmodified line101112131415161718192021222324252627282930311 unmodified lineimport gradio as grimport osimport jsonfrom transformers import pipeline# Set your API keypalm.configure(api_key=os.environ['PALM_KEY'])1 unmodified line# Select the PaLM 2 model# model = 'models/text-bison-001'# candlab= ["recharge coins or get subscription", "show list of my friends"]print(data["message"])def responsenew(data):response = palm.chat(messages=data)# user_intent = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")if "payment" in response.last:respo = {"message": "Click the button below to view Premium Services and Coin Recharge options: ","action": "payment","function": "nothing"}elif "friends" in response.last:respo = {"message": "Slide left or right profiles or tap on 'My Friends' to view list of your friends: ","action": "show_friends","function": "nothing"}
app.py+7-2