enable data storage
Browse files
app.py
CHANGED
|
@@ -148,15 +148,16 @@ def generate(
|
|
| 148 |
|
| 149 |
chat = [(history[i].strip(), history[i + 1].strip()) for i in range(0, len(history) - 1, 2)]
|
| 150 |
|
| 151 |
-
if HF_TOKEN and do_save:
|
| 152 |
-
try:
|
| 153 |
-
print("Pushing prompt and completion to the Hub")
|
| 154 |
-
save_inputs_and_outputs(prompt, output, generate_kwargs)
|
| 155 |
-
except Exception as e:
|
| 156 |
-
print(e)
|
| 157 |
-
|
| 158 |
yield chat, history, user_message, ""
|
| 159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
|
| 161 |
examples = [
|
| 162 |
"How can I write a Python function to generate the nth Fibonacci number?",
|
|
|
|
| 148 |
|
| 149 |
chat = [(history[i].strip(), history[i + 1].strip()) for i in range(0, len(history) - 1, 2)]
|
| 150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
yield chat, history, user_message, ""
|
| 152 |
+
|
| 153 |
+
if HF_TOKEN and do_save:
|
| 154 |
+
try:
|
| 155 |
+
print("Pushing prompt and completion to the Hub")
|
| 156 |
+
save_inputs_and_outputs(prompt, output, generate_kwargs)
|
| 157 |
+
except Exception as e:
|
| 158 |
+
print(e)
|
| 159 |
+
|
| 160 |
+
return chat, history, user_message, ""
|
| 161 |
|
| 162 |
examples = [
|
| 163 |
"How can I write a Python function to generate the nth Fibonacci number?",
|