Spaces:
Runtime error
Runtime error
adjust generation params
Browse files
app.py
CHANGED
|
@@ -46,7 +46,7 @@ my_cwd = str(cwd.resolve()) # string so it can be passed to os.path() objects
|
|
| 46 |
|
| 47 |
|
| 48 |
def chat(
|
| 49 |
-
prompt_message, temperature: float = 0.
|
| 50 |
) -> str:
|
| 51 |
"""
|
| 52 |
chat - the main function for the chatbot. This is the function that is called when the user
|
|
@@ -81,10 +81,10 @@ def ask_gpt(
|
|
| 81 |
speaker="person alpha",
|
| 82 |
responder="person beta",
|
| 83 |
min_length=4,
|
| 84 |
-
max_length=
|
| 85 |
top_p=0.95,
|
| 86 |
top_k=25,
|
| 87 |
-
temperature=0.
|
| 88 |
) -> str:
|
| 89 |
"""
|
| 90 |
ask_gpt - helper function that asks the GPT model a question and returns the response
|
|
@@ -223,15 +223,15 @@ if __name__ == "__main__":
|
|
| 223 |
examples_per_page=8,
|
| 224 |
examples=[
|
| 225 |
["Point Break or Bad Boys II?", 0.75, 0.95, 50],
|
| 226 |
-
["So... you're saying this wasn't an accident?", 0.6, 0.95,
|
| 227 |
["Hi, my name is Reginald", 0.6, 0.95, 100],
|
| 228 |
["Happy birthday!", 0.9, 0.95, 50],
|
| 229 |
["I have a question, can you help me?", 0.6, 0.95, 50],
|
| 230 |
["Do you know a joke?", 0.8, 0.85, 50],
|
| 231 |
["Will you marry me?", 0.9, 0.95, 100],
|
| 232 |
-
["Are you single?", 0.
|
| 233 |
["Do you like people?", 0.7, 0.95, 25],
|
| 234 |
-
["You never took a
|
| 235 |
],
|
| 236 |
title=f"GPT Chatbot Demo: {default_model} Model",
|
| 237 |
description=f"A Demo of a Chatbot trained for conversation with humans. Size XL= 1.5B parameters.\n\n"
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
def chat(
|
| 49 |
+
prompt_message, temperature: float = 0.5, top_p: float = 0.95, top_k: int = 20
|
| 50 |
) -> str:
|
| 51 |
"""
|
| 52 |
chat - the main function for the chatbot. This is the function that is called when the user
|
|
|
|
| 81 |
speaker="person alpha",
|
| 82 |
responder="person beta",
|
| 83 |
min_length=4,
|
| 84 |
+
max_length=48,
|
| 85 |
top_p=0.95,
|
| 86 |
top_k=25,
|
| 87 |
+
temperature=0.5,
|
| 88 |
) -> str:
|
| 89 |
"""
|
| 90 |
ask_gpt - helper function that asks the GPT model a question and returns the response
|
|
|
|
| 223 |
examples_per_page=8,
|
| 224 |
examples=[
|
| 225 |
["Point Break or Bad Boys II?", 0.75, 0.95, 50],
|
| 226 |
+
["So... you're saying this wasn't an accident?", 0.6, 0.95, 40],
|
| 227 |
["Hi, my name is Reginald", 0.6, 0.95, 100],
|
| 228 |
["Happy birthday!", 0.9, 0.95, 50],
|
| 229 |
["I have a question, can you help me?", 0.6, 0.95, 50],
|
| 230 |
["Do you know a joke?", 0.8, 0.85, 50],
|
| 231 |
["Will you marry me?", 0.9, 0.95, 100],
|
| 232 |
+
["Are you single?", 0.95, 0.95, 100],
|
| 233 |
["Do you like people?", 0.7, 0.95, 25],
|
| 234 |
+
["You never took a shortcut before?", 0.7, 0.95, 100],
|
| 235 |
],
|
| 236 |
title=f"GPT Chatbot Demo: {default_model} Model",
|
| 237 |
description=f"A Demo of a Chatbot trained for conversation with humans. Size XL= 1.5B parameters.\n\n"
|