write the app.py and upload data
Browse files
app.py
CHANGED
@@ -158,8 +158,8 @@ def display(access_key):
|
|
158 |
|
159 |
messages = []
|
160 |
for qa in qas:
|
161 |
-
messages.append({"role":"user", "content":
|
162 |
-
messages.append({"role":"assistant", "content":
|
163 |
num_tokens_processed = num_tokens_from_messages(messages)
|
164 |
num_tokens_total = num_tokens_processed * len(qs) / len(qas)
|
165 |
dollars_tokens_processed = 0.002 * int(num_tokens_processed/1000)
|
|
|
158 |
|
159 |
messages = []
|
160 |
for qa in qas:
|
161 |
+
messages.append({"role":"user", "content":qa["q"]})
|
162 |
+
messages.append({"role":"assistant", "content":qa["a"]})
|
163 |
num_tokens_processed = num_tokens_from_messages(messages)
|
164 |
num_tokens_total = num_tokens_processed * len(qs) / len(qas)
|
165 |
dollars_tokens_processed = 0.002 * int(num_tokens_processed/1000)
|