Update app.py
Browse files58 unmodified lines596061626364656618 unmodified lines858687868788899091929388899058 unmodified linesclient = InferenceClient('Qwen/Qwen2.5-72B-Instruct')#client is where you can change the LLM model!def respond(message,history): if not message.strip(): return "Hello!" gift_ideas = get_top_chunks(message) messages = [{'role': 'system', 'content': f'You give really good gift ideas and are super helpful! You also tell me the price of each item. Give me 5 gift ideas if I ask. Use the following database for gift ideas: {gift_ideas}'}] if history:18 unmodified lines #yield response["choices"][0]["message"]["content"].strip()
def echo(message,history): choices = ['It is certain','It is decidedly so', 'Without a doubt','Yes-definitely','You may rely on it','As I see it, yes','Most Likely', 'Outlook good.','Yes','Signs point to yes','Dont count on it','My reply is no' 'No.','very doubtful','ask again','cannot predict now','better not tell you now'] random_message = random.choice(choices) return random_messagechatbot = gr.ChatInterface(respond, type='messages', theme='hmb/amethyst')
chatbot.launch(debug=True)app.py+2-8