cyrus28214 commited on
Commit
48f8af8
·
1 Parent(s): bf59667

change model

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -4,8 +4,7 @@ from huggingface_hub import InferenceClient
4
  """
5
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
6
  """
7
- client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
8
-
9
 
10
  def respond(
11
  message,
@@ -17,11 +16,7 @@ def respond(
17
  ):
18
  messages = [{"role": "system", "content": system_message}]
19
 
20
- for val in history:
21
- if val[0]:
22
- messages.append({"role": "user", "content": val[0]})
23
- if val[1]:
24
- messages.append({"role": "assistant", "content": val[1]})
25
 
26
  messages.append({"role": "user", "content": message})
27
 
@@ -45,6 +40,7 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
45
  """
46
  demo = gr.ChatInterface(
47
  respond,
 
48
  additional_inputs=[
49
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
50
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
 
4
  """
5
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
6
  """
7
+ client = InferenceClient("csfufu/Revisual-R1-final")
 
8
 
9
  def respond(
10
  message,
 
16
  ):
17
  messages = [{"role": "system", "content": system_message}]
18
 
19
+ messages.extend(chat_history)
 
 
 
 
20
 
21
  messages.append({"role": "user", "content": message})
22
 
 
40
  """
41
  demo = gr.ChatInterface(
42
  respond,
43
+ type='messages',
44
  additional_inputs=[
45
  gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
46
  gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),