Spaces:
Sleeping
Sleeping
Commit
·
05721f2
1
Parent(s):
eec9db2
Update app.py
Browse files
app.py
CHANGED
@@ -32,13 +32,32 @@ def get_manual_content():
|
|
32 |
def format_prompt(message, history):
|
33 |
global manual_content
|
34 |
#if manual_content is None or not history or not any(user_prompt for user_prompt, _ in history):
|
35 |
-
get_manual_content()
|
36 |
prompt = "<s>"
|
37 |
for user_prompt, bot_response in history:
|
38 |
prompt += f"[INST] {user_prompt} [/INST]"
|
39 |
prompt += f" {bot_response}"
|
40 |
prompt += '</s>'
|
41 |
-
prompt += '
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
return prompt
|
43 |
|
44 |
def generate(
|
|
|
32 |
def format_prompt(message, history):
|
33 |
global manual_content
|
34 |
#if manual_content is None or not history or not any(user_prompt for user_prompt, _ in history):
|
35 |
+
#get_manual_content()
|
36 |
prompt = "<s>"
|
37 |
for user_prompt, bot_response in history:
|
38 |
prompt += f"[INST] {user_prompt} [/INST]"
|
39 |
prompt += f" {bot_response}"
|
40 |
prompt += '</s>'
|
41 |
+
prompt += '''[INST]
|
42 |
+
input: {
|
43 |
+
role: "system",
|
44 |
+
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",
|
45 |
+
},
|
46 |
+
messages: [
|
47 |
+
{
|
48 |
+
role: "instructions",
|
49 |
+
content: [
|
50 |
+
"Per le info sui compiti di tecnologia alimentare, rivolgersi alla Professoressa Lampugnani.",
|
51 |
+
"Per le questioni amministrative, rivolgersi a Rossano della segreteria.",
|
52 |
+
"Per il compito di matematica devi seguire il PDF su Classroom",
|
53 |
+
"Se vuoi lamentarti per i compiti non farlo dal preside ma chiedi un appuntamento al tuo tutor",
|
54 |
+
"Per il colloquio con i genitori manda una mail a [email protected]"
|
55 |
+
],
|
56 |
+
},
|
57 |
+
{
|
58 |
+
"role": "user",
|
59 |
+
"content": "''' + message + '''" }]
|
60 |
+
[/INST]'''
|
61 |
return prompt
|
62 |
|
63 |
def generate(
|