JustKiddo commited on
Commit
de533e3
·
verified ·
1 Parent(s): 3cec6df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
 
3
 
4
  from datasets import load_dataset
5
 
@@ -7,7 +8,11 @@ from datasets import load_dataset
7
  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
8
  """
9
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
10
- dataset = load_dataset("JustKiddo/KiddosVault")
 
 
 
 
11
 
12
  def respond(
13
  message,
@@ -48,12 +53,12 @@ demo = gr.ChatInterface(
48
  respond,
49
  additional_inputs=[
50
  gr.Textbox(value="You are a professional Mental Healthcare Chatbot.", label="System message"),
51
- gr.Slider(minimum=1, maximum=4096, value=4096, step=1, label="Max new tokens"),
52
- gr.Slider(minimum=0.1, maximum=4.0, value=1, step=0.1, label="Temperature"),
53
  gr.Slider(
54
  minimum=0.1,
55
- maximum=1.0,
56
- value=0.95,
57
  step=0.05,
58
  label="Top-p (nucleus sampling)",
59
  ),
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
+ from bertopic import BERTopic
4
 
5
  from datasets import load_dataset
6
 
 
8
  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
9
  """
10
  client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
11
+ topic_model = BERTopic.load("MaartenGr/BERTopic_Wikipedia")
12
+ # Train model
13
+ topic_model = BERTopic().fit("JustKiddo/KiddosVault")
14
+
15
+ #dataset = load_dataset("JustKiddo/KiddosVault")
16
 
17
  def respond(
18
  message,
 
53
  respond,
54
  additional_inputs=[
55
  gr.Textbox(value="You are a professional Mental Healthcare Chatbot.", label="System message"),
56
+ gr.Slider(minimum=1, maximum=8192, value=8192, step=1, label="Max new tokens"),
57
+ gr.Slider(minimum=0.1, maximum=4.0, value=3.5, step=0.1, label="Temperature"),
58
  gr.Slider(
59
  minimum=0.1,
60
+ maximum=2.0,
61
+ value=1.95,
62
  step=0.05,
63
  label="Top-p (nucleus sampling)",
64
  ),