Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -30,12 +30,13 @@ def write_elo_ratings(elo_ratings):
|
|
30 |
def format_alpaca_prompt(state):
|
31 |
alpaca_prompt = "Below is an instruction that describes a task. Write a response that appropriately completes the request."
|
32 |
for message in state["history"]:
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
|
|
39 |
return alpaca_prompt+"### Response:\n"
|
40 |
def get_bot_response(url, prompt,state):
|
41 |
alpaca_prompt = format_alpaca_prompt(state)
|
|
|
30 |
def format_alpaca_prompt(state):
|
31 |
alpaca_prompt = "Below is an instruction that describes a task. Write a response that appropriately completes the request."
|
32 |
for message in state["history"]:
|
33 |
+
for q in message:
|
34 |
+
j=""
|
35 |
+
if message['role']=='user':
|
36 |
+
j="### Instruction:\n"
|
37 |
+
else:
|
38 |
+
j="### Response:\n"
|
39 |
+
alpaca_prompt += j+ message['content']+"\n\n"
|
40 |
return alpaca_prompt+"### Response:\n"
|
41 |
def get_bot_response(url, prompt,state):
|
42 |
alpaca_prompt = format_alpaca_prompt(state)
|