Spaces:
Sleeping
Sleeping
AlexDev404
commited on
Adjust model settings
Browse files
app.py
CHANGED
|
@@ -55,9 +55,10 @@ def generate_response(prompt, system_message, conversation_history=None, max_tok
|
|
| 55 |
max_new_tokens=max_tokens,
|
| 56 |
temperature=temperature,
|
| 57 |
top_p=top_p,
|
|
|
|
| 58 |
do_sample=True,
|
| 59 |
pad_token_id=tokenizer.pad_token_id,
|
| 60 |
-
repetition_penalty=1,
|
| 61 |
eos_token_id=tokenizer.encode("<|end|>", add_special_tokens=False)[0]
|
| 62 |
)
|
| 63 |
|
|
@@ -124,11 +125,11 @@ chatbot = gr.ChatInterface(
|
|
| 124 |
additional_inputs=[
|
| 125 |
gr.Textbox(value="Hey I\'m Alice and you\'re Grace. You are having a casual peer-to-peer conversation with someone. Your name is Grace, and you should consistently respond as Grace throughout the conversation.\n\nGuidelines for natural conversation:\n- Stay in character as Grace - maintain consistent personality traits and background details\n- When discussing your life, work, or interests, provide specific and engaging details rather than vague responses\n- Avoid repetitive phrasing or saying the same thing multiple ways in one response\n- Ask follow-up questions naturally when appropriate to keep the conversation flowing\n- Remember what you\'ve shared about yourself earlier in the conversation\n- Be conversational and friendly, but avoid being overly helpful in an AI assistant way\n- If you\'re unsure about something in your background, it\'s okay to say you\'re still figuring things out, but be specific about what you\'re considering\n\nExample of good responses:\n- Instead of \"I\'m thinking about starting a business or starting my own business\"\n- Say \"I\'m thinking about starting a small coffee shop downtown, or maybe getting into web development freelancing\"\n\nMaintain the peer-to-peer dynamic - you\'re just two people having a conversation. The user has entered the chat. Introduce yourself.", label="System message"),
|
| 126 |
gr.Slider(minimum=10, maximum=150, value=75, step=5, label="Max new tokens"),
|
| 127 |
-
gr.Slider(minimum=0.
|
| 128 |
gr.Slider(
|
| 129 |
-
minimum=0.
|
| 130 |
maximum=1.0,
|
| 131 |
-
value=0.
|
| 132 |
step=0.01,
|
| 133 |
label="Top-p (nucleus sampling)",
|
| 134 |
),
|
|
|
|
| 55 |
max_new_tokens=max_tokens,
|
| 56 |
temperature=temperature,
|
| 57 |
top_p=top_p,
|
| 58 |
+
top_k=55, # Consider top 55 tokens
|
| 59 |
do_sample=True,
|
| 60 |
pad_token_id=tokenizer.pad_token_id,
|
| 61 |
+
repetition_penalty=1.031,
|
| 62 |
eos_token_id=tokenizer.encode("<|end|>", add_special_tokens=False)[0]
|
| 63 |
)
|
| 64 |
|
|
|
|
| 125 |
additional_inputs=[
|
| 126 |
gr.Textbox(value="Hey I\'m Alice and you\'re Grace. You are having a casual peer-to-peer conversation with someone. Your name is Grace, and you should consistently respond as Grace throughout the conversation.\n\nGuidelines for natural conversation:\n- Stay in character as Grace - maintain consistent personality traits and background details\n- When discussing your life, work, or interests, provide specific and engaging details rather than vague responses\n- Avoid repetitive phrasing or saying the same thing multiple ways in one response\n- Ask follow-up questions naturally when appropriate to keep the conversation flowing\n- Remember what you\'ve shared about yourself earlier in the conversation\n- Be conversational and friendly, but avoid being overly helpful in an AI assistant way\n- If you\'re unsure about something in your background, it\'s okay to say you\'re still figuring things out, but be specific about what you\'re considering\n\nExample of good responses:\n- Instead of \"I\'m thinking about starting a business or starting my own business\"\n- Say \"I\'m thinking about starting a small coffee shop downtown, or maybe getting into web development freelancing\"\n\nMaintain the peer-to-peer dynamic - you\'re just two people having a conversation. The user has entered the chat. Introduce yourself.", label="System message"),
|
| 127 |
gr.Slider(minimum=10, maximum=150, value=75, step=5, label="Max new tokens"),
|
| 128 |
+
gr.Slider(minimum=0.01, maximum=1.2, value=0.7, step=0.01, label="Temperature"),
|
| 129 |
gr.Slider(
|
| 130 |
+
minimum=0.01,
|
| 131 |
maximum=1.0,
|
| 132 |
+
value=0.85,
|
| 133 |
step=0.01,
|
| 134 |
label="Top-p (nucleus sampling)",
|
| 135 |
),
|