DQN-Labs commited on
Commit
3f1d37e
·
verified ·
1 Parent(s): ccaf38d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -13
app.py CHANGED
@@ -3,14 +3,8 @@ from transformers import AutoTokenizer, AutoModelForCausalLM, TextIteratorStream
3
  import torch
4
  from threading import Thread
5
  MODEL_NAMES = {
6
- "LFM2-350M": "LiquidAI/LFM2-350M", # LFM2 - 350M
7
- "LFM2-700M": "LiquidAI/LFM2-700M", # LFM2 - 700M
8
- "LFM2-1.2B": "LiquidAI/LFM2-1.2B", # LFM2 - 1.2B
9
- "LFM2.5-1.2B": "LiquidAI/LFM2.5-1.2B-Instruct", # LFM2.5 - 1.2B
10
- "LFM2.5-1.2B-Thinking": "LiquidAI/LFM2.5-1.2B-Thinking", # LFM2.5 - 1.2B (Thinking)
11
- "LFM2-2.6B": "LiquidAI/LFM2-2.6B", # LFM2 - 2.6B
12
- "LFM2-8B-A1B": "LiquidAI/LFM2-8B-A1B", # LFM2 - 8B-A1B
13
- "LFM2-24B-A3B": "LiquidAI/LFM2-24B-A2B", # LFM2 - 24B-A3B
14
  }
15
  model_cache = {}
16
  def load_model(model_key):
@@ -55,19 +49,19 @@ def chat_with_model(message, history, model_choice):
55
  {"role": "assistant", "content": partial_text},
56
  ]
57
  def create_demo():
58
- with gr.Blocks(title="LiquidAI Chat Playground") as demo:
59
- gr.Markdown("## 💧 LiquidAI Chat Playground")
60
  model_choice = gr.Dropdown(
61
  label="Select Model",
62
  choices=list(MODEL_NAMES.keys()),
63
- value="LFM2-1.2B"
64
  )
65
  chatbot = gr.Chatbot(
66
- label="Chat with LiquidAI",
67
  type="messages",
68
  height=450
69
  )
70
- msg = gr.Textbox(label="Your message", placeholder="Type something...")
71
  clear = gr.Button("Clear")
72
  def add_user_message(user_message, chat_history):
73
  chat_history = chat_history + [{"role": "user", "content": user_message}]
 
3
  import torch
4
  from threading import Thread
5
  MODEL_NAMES = {
6
+ "dqnCode v0.2 1.5B": "DQN-Labs/dqnCode-v0.2-1.5B-HF",
7
+ "dqnCode v0.3 1.2B": "DQN-Labs/dqnCode-v0.3-1.2B-MLX-4bit",
 
 
 
 
 
 
8
  }
9
  model_cache = {}
10
  def load_model(model_key):
 
49
  {"role": "assistant", "content": partial_text},
50
  ]
51
  def create_demo():
52
+ with gr.Blocks(title="DQN Labs Chat") as demo:
53
+ gr.Markdown("## DQN Labs Chat")
54
  model_choice = gr.Dropdown(
55
  label="Select Model",
56
  choices=list(MODEL_NAMES.keys()),
57
+ value="dqnCode v0.2 1.5B"
58
  )
59
  chatbot = gr.Chatbot(
60
+ label="Chat with DQN!",
61
  type="messages",
62
  height=450
63
  )
64
+ msg = gr.Textbox(label="Your message", placeholder="Type away...")
65
  clear = gr.Button("Clear")
66
  def add_user_message(user_message, chat_history):
67
  chat_history = chat_history + [{"role": "user", "content": user_message}]