feleanicusor commited on
Commit
f688e19
·
verified ·
1 Parent(s): bf9977d

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -25,8 +25,10 @@ print("Model loaded!")
25
 
26
  def chat(message, history):
27
  messages = [{"role": "system", "content": "You are a helpful assistant."}]
28
- for msg in history:
29
- messages.append({"role": msg["role"], "content": msg["content"]})
 
 
30
  messages.append({"role": "user", "content": message})
31
 
32
  text = tokenizer.apply_chat_template(
@@ -59,6 +61,5 @@ demo = gr.ChatInterface(
59
  chat,
60
  title="Huihui-Qwen3.5-35B-A3B Abliterated",
61
  description="Chat with the abliterated Qwen3.5-35B-A3B model (4-bit quantized, uncensored)",
62
- type="messages",
63
  )
64
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
25
 
26
  def chat(message, history):
27
  messages = [{"role": "system", "content": "You are a helpful assistant."}]
28
+ for user_msg, bot_msg in history:
29
+ messages.append({"role": "user", "content": user_msg})
30
+ if bot_msg:
31
+ messages.append({"role": "assistant", "content": bot_msg})
32
  messages.append({"role": "user", "content": message})
33
 
34
  text = tokenizer.apply_chat_template(
 
61
  chat,
62
  title="Huihui-Qwen3.5-35B-A3B Abliterated",
63
  description="Chat with the abliterated Qwen3.5-35B-A3B model (4-bit quantized, uncensored)",
 
64
  )
65
  demo.launch(server_name="0.0.0.0", server_port=7860)