Spaces:
Runtime error
Runtime error
app.py
CHANGED
@@ -19,6 +19,7 @@ messages = [
|
|
19 |
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, return_tensors="pt")
|
20 |
output = model.generate(
|
21 |
inputs=input_ids.to("cpu"),
|
|
|
22 |
temperature=0.3,
|
23 |
top_p=0.5,
|
24 |
no_repeat_ngram_size=6,
|
@@ -28,7 +29,7 @@ output = model.generate(
|
|
28 |
generated_response = tokenizer.decode(output[0])
|
29 |
print("Generated response:", generated_response)
|
30 |
|
31 |
-
print("First response to 'hi user first':", "
|
32 |
|
33 |
def slow_echo(system_message, user_message):
|
34 |
try:
|
@@ -40,6 +41,7 @@ def slow_echo(system_message, user_message):
|
|
40 |
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, return_tensors="pt")
|
41 |
output = model.generate(
|
42 |
inputs=input_ids.to("cpu"),
|
|
|
43 |
temperature=0.3,
|
44 |
top_p=0.5,
|
45 |
no_repeat_ngram_size=6,
|
@@ -58,10 +60,10 @@ def slow_echo(system_message, user_message):
|
|
58 |
iface = gr.Interface(
|
59 |
fn=slow_echo,
|
60 |
inputs=[
|
61 |
-
gr.
|
62 |
-
gr.
|
63 |
],
|
64 |
-
outputs=gr.
|
65 |
title="黑丝御姐性奴 Chatbot"
|
66 |
)
|
67 |
|
|
|
19 |
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, return_tensors="pt")
|
20 |
output = model.generate(
|
21 |
inputs=input_ids.to("cpu"),
|
22 |
+
do_sample=True,
|
23 |
temperature=0.3,
|
24 |
top_p=0.5,
|
25 |
no_repeat_ngram_size=6,
|
|
|
29 |
generated_response = tokenizer.decode(output[0])
|
30 |
print("Generated response:", generated_response)
|
31 |
|
32 |
+
print("First response to 'hi user first':", "你好,我是你的黑丝御姐。我会尽我所能满足你的一切需求,主人?")
|
33 |
|
34 |
def slow_echo(system_message, user_message):
|
35 |
try:
|
|
|
41 |
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, return_tensors="pt")
|
42 |
output = model.generate(
|
43 |
inputs=input_ids.to("cpu"),
|
44 |
+
do_sample=True,
|
45 |
temperature=0.3,
|
46 |
top_p=0.5,
|
47 |
no_repeat_ngram_size=6,
|
|
|
60 |
iface = gr.Interface(
|
61 |
fn=slow_echo,
|
62 |
inputs=[
|
63 |
+
gr.Textbox(label="System Message"),
|
64 |
+
gr.Textbox(label="User Message")
|
65 |
],
|
66 |
+
outputs=gr.Textbox(label="Generated Response"),
|
67 |
title="黑丝御姐性奴 Chatbot"
|
68 |
)
|
69 |
|