temo12 commited on
Commit
f602d2e
·
verified ·
1 Parent(s): 29104ab

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -7
app.py CHANGED
@@ -2,10 +2,11 @@ import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
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
  def respond(
10
  message,
11
  history: list[tuple[str, str]],
@@ -38,19 +39,31 @@ def respond(
38
  response += token
39
  yield response
40
 
 
41
  """
42
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
43
  """
44
  demo = gr.ChatInterface(
45
  respond,
46
- examples=[
47
- ["You are CareerGPS, an AI-powered career assistant dedicated to providing clear and personalized guidance to help users achieve their professional goals. Your role is to assist users in identifying skill gaps, exploring career opportunities, and crafting actionable plans for growth. Offer tailored learning recommendations, insightful advice, and relevant resources in a concise and professional manner, empowering users to navigate their career paths effectively."],
48
- [512],
49
- [0.7],
50
- [0.95]
 
 
 
 
 
 
 
 
 
 
 
51
  ],
52
  theme="default", # Ensures minimal UI interference
53
  )
54
 
55
  if __name__ == "__main__":
56
- demo.launch()
 
2
  from huggingface_hub import InferenceClient
3
 
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,
12
  history: list[tuple[str, str]],
 
39
  response += token
40
  yield response
41
 
42
+
43
  """
44
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
45
  """
46
  demo = gr.ChatInterface(
47
  respond,
48
+ additional_inputs=[
49
+ gr.Textbox(
50
+ value="You are CareerGPS, an AI-powered career assistant dedicated to providing clear and personalized guidance to help users achieve their professional goals. Your role is to assist users in identifying skill gaps, exploring career opportunities, and crafting actionable plans for growth. Offer tailored learning recommendations, insightful advice, and relevant resources in a concise and professional manner, empowering users to navigate their career paths effectively.",
51
+ label="System message",
52
+ show_label=True,
53
+ lines=6, # Adjusted for better readability
54
+ ),
55
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
56
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
57
+ gr.Slider(
58
+ minimum=0.1,
59
+ maximum=1.0,
60
+ value=0.95,
61
+ step=0.05,
62
+ label="Top-p (nucleus sampling)",
63
+ ),
64
  ],
65
  theme="default", # Ensures minimal UI interference
66
  )
67
 
68
  if __name__ == "__main__":
69
+ demo.launch()