Spaces:
Running
Running
ryanrwatkins
commited on
Commit
•
5a8bec0
1
Parent(s):
2ea60c5
Update app.py
Browse files
app.py
CHANGED
@@ -125,7 +125,7 @@ def submit_message(prompt, prompt_template, temperature, max_tokens, context_len
|
|
125 |
# https://colab.research.google.com/drive/1dzdNDZyofRB0f2KIB4gHXmIza7ehMX30?usp=sharing#scrollTo=b-ejDn_JfpWW
|
126 |
|
127 |
history.append(prompt_msg)
|
128 |
-
history.append(completion)
|
129 |
#history.append(completion.choices[0].message.to_dict())
|
130 |
#history.append(completion["result"].choices[0].message.to_dict())
|
131 |
|
@@ -133,10 +133,7 @@ def submit_message(prompt, prompt_template, temperature, max_tokens, context_len
|
|
133 |
|
134 |
except Exception as e:
|
135 |
history.append(prompt_msg)
|
136 |
-
history.append(
|
137 |
-
"role": "system",
|
138 |
-
"content": f"Error: {e}"
|
139 |
-
})
|
140 |
|
141 |
total_tokens_used_msg = f"Total tokens used: {state['total_tokens']}"
|
142 |
chat_messages = [(history[i]['content'], history[i+1]['content']) for i in range(0, len(history)-1, 2)]
|
|
|
125 |
# https://colab.research.google.com/drive/1dzdNDZyofRB0f2KIB4gHXmIza7ehMX30?usp=sharing#scrollTo=b-ejDn_JfpWW
|
126 |
|
127 |
history.append(prompt_msg)
|
128 |
+
history.append(completion.message.to_dict())
|
129 |
#history.append(completion.choices[0].message.to_dict())
|
130 |
#history.append(completion["result"].choices[0].message.to_dict())
|
131 |
|
|
|
133 |
|
134 |
except Exception as e:
|
135 |
history.append(prompt_msg)
|
136 |
+
history.append("error")
|
|
|
|
|
|
|
137 |
|
138 |
total_tokens_used_msg = f"Total tokens used: {state['total_tokens']}"
|
139 |
chat_messages = [(history[i]['content'], history[i+1]['content']) for i in range(0, len(history)-1, 2)]
|