Model Selections ? - What wind.surf will do ?
Browse files
app.py
CHANGED
@@ -45,7 +45,7 @@ def respond(
|
|
45 |
global current_model
|
46 |
|
47 |
# Load new model if changed
|
48 |
-
if current_model is None or model_name
|
49 |
current_model = load_model(model_name)
|
50 |
|
51 |
messages = [{"role": "system", "content": system_message}]
|
@@ -73,20 +73,19 @@ def respond(
|
|
73 |
chunk['choices'][0]["delta"]["content"]
|
74 |
yield message_repl
|
75 |
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
demo = gr.ChatInterface(
|
80 |
respond,
|
81 |
-
title=
|
82 |
-
description="Try models locclay in:
|
83 |
-
|
84 |
additional_inputs=[
|
85 |
gr.Dropdown(
|
86 |
choices=list(MODELS.keys()),
|
87 |
value=list(MODELS.keys())[0],
|
88 |
label="Select Model",
|
89 |
-
interactive=
|
90 |
allow_custom_value=False
|
91 |
),
|
92 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
@@ -146,6 +145,5 @@ demo = gr.ChatInterface(
|
|
146 |
"""
|
147 |
)
|
148 |
|
149 |
-
|
150 |
if __name__ == "__main__":
|
151 |
demo.launch()
|
|
|
45 |
global current_model
|
46 |
|
47 |
# Load new model if changed
|
48 |
+
if current_model is None or model_name not in str(current_model.model_path):
|
49 |
current_model = load_model(model_name)
|
50 |
|
51 |
messages = [{"role": "system", "content": system_message}]
|
|
|
73 |
chunk['choices'][0]["delta"]["content"]
|
74 |
yield message_repl
|
75 |
|
76 |
+
def get_chat_title(model_name):
|
77 |
+
return f"{model_name} - GGUF is popular format on PC in LM Studio or on Tablet/Mobile in PocketPal APPs"
|
78 |
+
|
79 |
demo = gr.ChatInterface(
|
80 |
respond,
|
81 |
+
title=get_chat_title(list(MODELS.keys())[0]),
|
82 |
+
description="Try models locclay in: [LM Studio AI for PC](https://lmstudio.ai) | PocketPal AI ([Android](https://play.google.com/store/apps/details?id=com.pocketpalai) & [iOS](https://play.google.com/store/apps/details?id=com.pocketpalai)) on Tablet or Mobile",
|
|
|
83 |
additional_inputs=[
|
84 |
gr.Dropdown(
|
85 |
choices=list(MODELS.keys()),
|
86 |
value=list(MODELS.keys())[0],
|
87 |
label="Select Model",
|
88 |
+
interactive=True,
|
89 |
allow_custom_value=False
|
90 |
),
|
91 |
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
|
|
145 |
"""
|
146 |
)
|
147 |
|
|
|
148 |
if __name__ == "__main__":
|
149 |
demo.launch()
|