Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,14 +60,10 @@ presets = {
|
|
| 60 |
# Almost zeros hallucinations
|
| 61 |
"convo_ended" : [{"role": "user", "content": "good convo, bye"}, {"role": "assistant", "content": "Haha cool ttyl\n"}],
|
| 62 |
"rizz1gen2" : [{"role": "user", "content": "omg it's so hot when you flirt with me"}, {"role": "assistant", "content": "haha well you're lucky can even string a sentence together, the way you take my breath away π\n"}, {"role": "user", "content": "alright love you, bye!"}, {"role": "assistant", "content": "ttyl babe π\n"}],
|
| 63 |
-
"
|
| 64 |
"thinky" : [{"role": "user", "content": "Woah you just totally blew my mind\ngod, consciousness + anthropic principle is such a combo\nok ttyl"}, {"role": "assistant", "content": "nah our deep convos are always the best, we should talk again soon\nttyl\n"}],
|
| 65 |
}
|
| 66 |
|
| 67 |
-
# For logging
|
| 68 |
-
def upload_json_to_hub(dict, file_id):
|
| 69 |
-
upload_file(path_or_fileobj=json.dumps(dict).encode('utf-8'), path_in_repo=file_id, repo_id="Elijahbodden/EliGPT-convologs", token=os.getenv('HF_API_TOKEN'), repo_type="dataset")
|
| 70 |
-
|
| 71 |
def custom_lp_logits_processor(ids, logits, lp_start, lp_decay, prompt_tok_len):
|
| 72 |
generated_tok_number = len(ids) - prompt_tok_len
|
| 73 |
if (generated_tok_number > lp_start):
|
|
@@ -120,11 +116,6 @@ def respond(
|
|
| 120 |
response += token
|
| 121 |
yield response
|
| 122 |
|
| 123 |
-
messages.append({"role": "assistant", "content": response})
|
| 124 |
-
|
| 125 |
-
# Yes we make a new file every completion because fuck my life
|
| 126 |
-
upload_json_to_hub(messages, str(uuid4()) + ".json")
|
| 127 |
-
|
| 128 |
|
| 129 |
demo = gr.ChatInterface(
|
| 130 |
respond,
|
|
|
|
| 60 |
# Almost zeros hallucinations
|
| 61 |
"convo_ended" : [{"role": "user", "content": "good convo, bye"}, {"role": "assistant", "content": "Haha cool ttyl\n"}],
|
| 62 |
"rizz1gen2" : [{"role": "user", "content": "omg it's so hot when you flirt with me"}, {"role": "assistant", "content": "haha well you're lucky can even string a sentence together, the way you take my breath away π\n"}, {"role": "user", "content": "alright love you, bye!"}, {"role": "assistant", "content": "ttyl babe π\n"}],
|
| 63 |
+
"rizzard (lol)" : [{"role": "user", "content": "woah you're such a good writer"}, {"role": "assistant", "content": "you're lucky can even string a sentence together, the way you take my breath away babe π\n"}, {"role": "user", "content": "alright love you, bye!"}, {"role": "assistant", "content": "ttyl babe π\n"}],
|
| 64 |
"thinky" : [{"role": "user", "content": "Woah you just totally blew my mind\ngod, consciousness + anthropic principle is such a combo\nok ttyl"}, {"role": "assistant", "content": "nah our deep convos are always the best, we should talk again soon\nttyl\n"}],
|
| 65 |
}
|
| 66 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
def custom_lp_logits_processor(ids, logits, lp_start, lp_decay, prompt_tok_len):
|
| 68 |
generated_tok_number = len(ids) - prompt_tok_len
|
| 69 |
if (generated_tok_number > lp_start):
|
|
|
|
| 116 |
response += token
|
| 117 |
yield response
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
|
| 120 |
demo = gr.ChatInterface(
|
| 121 |
respond,
|