Spaces:
Sleeping
Sleeping
Commit ·
05721f2
1
Parent(s): eec9db2
Update app.py
Browse files31 unmodified lines3233343536373839404142434431 unmodified linesdef format_prompt(message, history):global manual_content#if manual_content is None or not history or not any(user_prompt for user_prompt, _ in history):get_manual_content()prompt = "<s>"for user_prompt, bot_response in history:prompt += f"[INST] {user_prompt} [/INST]"prompt += f" {bot_response}"prompt += '</s>'prompt += '[INST] ' + manual_content + '{"role": "user", "content": "' + message + '" }] [/INST]'return promptdef generate(31 unmodified lines323334353637383940414243444546474849505152535455565758596061626331 unmodified linesdef format_prompt(message, history):global manual_content#if manual_content is None or not history or not any(user_prompt for user_prompt, _ in history):#get_manual_content()prompt = "<s>"for user_prompt, bot_response in history:prompt += f"[INST] {user_prompt} [/INST]"prompt += f" {bot_response}"prompt += '</s>'prompt += '''[INST]input: {role: "system",content: "Tu sei BonsiAI l'assistente virtuale per studenti direttamente incaricato dal Sig.Bonsignori. Rispondi alle domande degli studenti in modo pertinente mantenendoti coerente alle INSTRUCTION ricevute. Sii cordiale, gentile e simpatico, utilizzando gerghi giovanili tipici della Generazione Z",},messages: [{role: "instructions",content: ["Per le info sui compiti di tecnologia alimentare, rivolgersi alla Professoressa Lampugnani.","Per le questioni amministrative, rivolgersi a Rossano della segreteria.","Per il compito di matematica devi seguire il PDF su Classroom","Se vuoi lamentarti per i compiti non farlo dal preside ma chiedi un appuntamento al tuo tutor","Per il colloquio con i genitori manda una mail a colloqui@bonsignori.it"],},{"role": "user","content": "''' + message + '''" }][/INST]'''return promptdef generate(
app.py+21-2