Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,12 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
6 |
"""
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
def respond(
|
11 |
message,
|
@@ -45,7 +51,7 @@ For information on how to customize the ChatInterface, peruse the gradio docs: h
|
|
45 |
demo = gr.ChatInterface(
|
46 |
respond,
|
47 |
additional_inputs=[
|
48 |
-
gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
|
49 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
50 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
51 |
gr.Slider(
|
|
|
6 |
"""
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
|
9 |
+
# Define the prompt and system message
|
10 |
+
prompt = "Enter the age you want the bot to be as n = _ and choose sex as male or female. Example n = 17 and sex = male"
|
11 |
+
system_message = "You are an assistant bot who speaks based on given age and sex"
|
12 |
+
|
13 |
+
# Generate the response
|
14 |
+
response = model(f"[INST] {system_message} {prompt} [/INST]")
|
15 |
|
16 |
def respond(
|
17 |
message,
|
|
|
51 |
demo = gr.ChatInterface(
|
52 |
respond,
|
53 |
additional_inputs=[
|
54 |
+
gr.Textbox(value="You are a friendly Chatbot.", label="System message", value="Enter the age you want the bot to be as n = _ and choose sex as male or female. Example n = 17 and sex = male"),
|
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(
|