Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,10 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def respond(
|
| 8 |
message,
|
|
@@ -36,10 +38,21 @@ def respond(
|
|
| 36 |
response += token
|
| 37 |
yield response
|
| 38 |
|
|
|
|
|
|
|
|
|
|
| 39 |
demo = gr.ChatInterface(
|
| 40 |
respond,
|
| 41 |
additional_inputs=[
|
| 42 |
-
gr.Textbox(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 44 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 45 |
gr.Slider(
|
|
|
|
| 1 |
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(model="HuggingFaceH4/zephyr-7b-beta")
|
| 8 |
|
| 9 |
def respond(
|
| 10 |
message,
|
|
|
|
| 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 |
additional_inputs=[
|
| 47 |
+
gr.Textbox(
|
| 48 |
+
value=(
|
| 49 |
+
"You are a chatbot interviewer. Your role is to test the managerial skills of candidates. "
|
| 50 |
+
"Ask questions that evaluate the candidate's leadership, decision-making, problem-solving, "
|
| 51 |
+
"and communication abilities. Provide feedback on their responses and score them based on "
|
| 52 |
+
"the depth and quality of their answers."
|
| 53 |
+
),
|
| 54 |
+
label="System message"
|
| 55 |
+
),
|
| 56 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
| 57 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 58 |
gr.Slider(
|