Spaces:
Running
Running
Elijahbodden
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -76,7 +76,8 @@ def respond(
|
|
76 |
response = ""
|
77 |
|
78 |
print(tokenizer.apply_chat_template(messages, tokenize=False))
|
79 |
-
|
|
|
80 |
|
81 |
convo = tokenizer.apply_chat_template(messages, tokenize=True)
|
82 |
for message in model.create_completion(
|
@@ -97,7 +98,8 @@ def respond(
|
|
97 |
response += token
|
98 |
yield response
|
99 |
print(response)
|
100 |
-
|
|
|
101 |
|
102 |
ci = gr.ChatInterface(
|
103 |
respond,
|
@@ -107,7 +109,7 @@ ci = gr.ChatInterface(
|
|
107 |
# ("The model will become slow" is bc this uncaches the prompt and prompt processing is a big part of the generation time)
|
108 |
gr.Slider(minimum=0.0, maximum=1.0, value=0.1, step=0.01, label="Min_p", info="Lower values give it more \"personality\""),
|
109 |
gr.Slider(minimum=0.1, maximum=4.0, value=1.5, step=0.1, label="Temperature", info="How chaotic should the model be?"),
|
110 |
-
gr.Slider(minimum=0, maximum=512, value=
|
111 |
gr.Slider(minimum=0.5, maximum=1.5, value=1.015, step=0.001, label="Length penalty decay factor", info='How fast should that stop likelihood increase?'),
|
112 |
gr.Slider(minimum=0.0, maximum=1.0, value=0.1, step=0.01, label="Frequency penalty", info='"Don\'repeat yourself"'),
|
113 |
gr.Slider(minimum=0.0, maximum=1.0, value=0.1, step=0.01, label="Presence penalty", info='"Use lots of diverse words"'),
|
|
|
76 |
response = ""
|
77 |
|
78 |
print(tokenizer.apply_chat_template(messages, tokenize=False))
|
79 |
+
with open('/data/log.txt', 'a') as f:
|
80 |
+
print(tokenizer.apply_chat_template(messages, tokenize=False), file=f)
|
81 |
|
82 |
convo = tokenizer.apply_chat_template(messages, tokenize=True)
|
83 |
for message in model.create_completion(
|
|
|
98 |
response += token
|
99 |
yield response
|
100 |
print(response)
|
101 |
+
with open('/data/log.txt', 'a') as f:
|
102 |
+
print(response, file=f)
|
103 |
|
104 |
ci = gr.ChatInterface(
|
105 |
respond,
|
|
|
109 |
# ("The model will become slow" is bc this uncaches the prompt and prompt processing is a big part of the generation time)
|
110 |
gr.Slider(minimum=0.0, maximum=1.0, value=0.1, step=0.01, label="Min_p", info="Lower values give it more \"personality\""),
|
111 |
gr.Slider(minimum=0.1, maximum=4.0, value=1.5, step=0.1, label="Temperature", info="How chaotic should the model be?"),
|
112 |
+
gr.Slider(minimum=0, maximum=512, value=10, step=1, label="Length penalty start", info='When should the model start being more likely to shut up?'),
|
113 |
gr.Slider(minimum=0.5, maximum=1.5, value=1.015, step=0.001, label="Length penalty decay factor", info='How fast should that stop likelihood increase?'),
|
114 |
gr.Slider(minimum=0.0, maximum=1.0, value=0.1, step=0.01, label="Frequency penalty", info='"Don\'repeat yourself"'),
|
115 |
gr.Slider(minimum=0.0, maximum=1.0, value=0.1, step=0.01, label="Presence penalty", info='"Use lots of diverse words"'),
|