GueuleDange commited on
Commit
033ae3f
·
verified ·
1 Parent(s): 3cf7dd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -1
app.py CHANGED
@@ -7,10 +7,11 @@ HF_TOKEN = os.environ.get("HF_TOKEN")
7
 
8
  def respond(
9
  message,
 
 
10
  max_tokens,
11
  temperature,
12
  top_p,
13
-
14
  ):
15
  """
16
  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
@@ -45,7 +46,26 @@ def respond(
45
 
46
  except Exception as e:
47
  yield f"❌ Erreur : {str(e)}"
 
 
 
 
48
  """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  )
50
 
51
  with gr.Blocks() as demo:
 
7
 
8
  def respond(
9
  message,
10
+ history: list[dict[str, str]],
11
+ system_message,
12
  max_tokens,
13
  temperature,
14
  top_p,
 
15
  ):
16
  """
17
  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
 
46
 
47
  except Exception as e:
48
  yield f"❌ Erreur : {str(e)}"
49
+
50
+
51
+ """
52
+ For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
53
  """
54
+ chatbot = gr.ChatInterface(
55
+ respond,
56
+ type="messages",
57
+ additional_inputs=[
58
+ gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
59
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
60
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
61
+ gr.Slider(
62
+ minimum=0.1,
63
+ maximum=1.0,
64
+ value=0.95,
65
+ step=0.05,
66
+ label="Top-p (nucleus sampling)",
67
+ ),
68
+ ],
69
  )
70
 
71
  with gr.Blocks() as demo: