Spaces:
Runtime error
Runtime error
Commit
·
43b8dd7
1
Parent(s):
181d76c
Added info field
Browse files
app.py
CHANGED
|
@@ -14,6 +14,9 @@ model_names = list(config.keys())
|
|
| 14 |
personas = list(OrderedDict.fromkeys(persona for name in config for persona in config[name]["personas"]))
|
| 15 |
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
clients = {}
|
| 18 |
for name in config:
|
| 19 |
client = OpenAI(
|
|
@@ -29,6 +32,7 @@ def respond(
|
|
| 29 |
history: List[Tuple[str, str]],
|
| 30 |
persona,
|
| 31 |
model,
|
|
|
|
| 32 |
conversational,
|
| 33 |
max_tokens,
|
| 34 |
):
|
|
@@ -71,6 +75,7 @@ demo = gr.ChatInterface(
|
|
| 71 |
additional_inputs=[
|
| 72 |
gr.Radio(choices=personas, value="default", label="persona"),
|
| 73 |
gr.Radio(choices=model_names, value="stable", label="model"),
|
|
|
|
| 74 |
gr.Checkbox(value=True, label="conversational"),
|
| 75 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 76 |
],
|
|
|
|
| 14 |
personas = list(OrderedDict.fromkeys(persona for name in config for persona in config[name]["personas"]))
|
| 15 |
|
| 16 |
|
| 17 |
+
info = "\n".join([f"{model} ({config[model]['name']}): {list(config[model]['personas'].keys())}" for model in model_names])
|
| 18 |
+
|
| 19 |
+
|
| 20 |
clients = {}
|
| 21 |
for name in config:
|
| 22 |
client = OpenAI(
|
|
|
|
| 32 |
history: List[Tuple[str, str]],
|
| 33 |
persona,
|
| 34 |
model,
|
| 35 |
+
info,
|
| 36 |
conversational,
|
| 37 |
max_tokens,
|
| 38 |
):
|
|
|
|
| 75 |
additional_inputs=[
|
| 76 |
gr.Radio(choices=personas, value="default", label="persona"),
|
| 77 |
gr.Radio(choices=model_names, value="stable", label="model"),
|
| 78 |
+
gr.Textbox(value=info, interactive=False, label="info"),
|
| 79 |
gr.Checkbox(value=True, label="conversational"),
|
| 80 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 81 |
],
|