Spaces:
Sleeping
Sleeping
debugging
Browse files59 unmodified lines6061626364656667686970717273741 unmodified line767778798081826 unmodified lines89909192939495969759 unmodified linescontext = "\n- ".join(retrieved_info)system_prompt = f"""You are 'CityScout', a friendly guide to unique hangout spots.Use the following verified facts from our database to help the user:- {context}If you find a match, describe it enthusiastically! If not, help them brainstorm based on their interests."""#use the processed data in the role promptmessages = [{"role": "system", "content": system_prompt}]for user_msg, assistant_msg in history:if user_msg: messages.append({"role": "user", "content": user_msg})if assistant_msg: messages.append({"role": "assistant", "content": assistant_msg})for msg in history:messages.append(msg)1 unmodified linemessages.append({"role": "user", "content": message})response = ""for chunk in client.chat_completion(messages,max_tokens=500,6 unmodified linesresponse += tokenyield responsechatbot = gr.ChatInterface(respond,title="CityScout: Unique Spot Finder",description="Tell me your city and interests to find a cool spot!")chatbot.launch()59 unmodified lines6061626364656667686970717273741 unmodified line7677787980816 unmodified lines888990919293949596979859 unmodified linescontext = "\n- ".join(retrieved_info)system_prompt = f"""You are 'CityScout', a friendly guide to unique hangout spots.Use the following verified facts from our database to help the user.Always mention the name of the spot found in the brackets [Like This].Database Facts:- {context}If you find a match, describe it enthusiastically! If not, help them brainstorm based on their interests."""messages = [{"role": "system", "content": system_prompt}]for msg in history:messages.append(msg)1 unmodified linemessages.append({"role": "user", "content": message})response = ""for chunk in client.chat_completion(messages,max_tokens=500,6 unmodified linesresponse += tokenyield responsechatbot = gr.ChatInterface(respond,type="messages",title="CityScout: Unique Spot Finder",description="Tell me your city and interests to find a cool spot!")chatbot.launch()
app.py+10-9