Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,11 +10,13 @@ client = InferenceClient("Qwen/Qwen2.5-Coder-32B-Instruct")
|
|
| 10 |
def respond(
|
| 11 |
message,
|
| 12 |
history: list[tuple[str, str]],
|
| 13 |
-
system_message,
|
| 14 |
max_tokens,
|
| 15 |
temperature,
|
| 16 |
top_p,
|
| 17 |
):
|
|
|
|
|
|
|
|
|
|
| 18 |
messages = [{"role": "system", "content": system_message}]
|
| 19 |
|
| 20 |
for val in history:
|
|
@@ -43,10 +45,11 @@ def respond(
|
|
| 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(value="You are a friendly Chatbot.", label="System message"),
|
| 50 |
gr.Slider(minimum=1, maximum=2048, value=2048, step=1, label="Max new tokens"),
|
| 51 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 52 |
gr.Slider(
|
|
|
|
| 10 |
def respond(
|
| 11 |
message,
|
| 12 |
history: list[tuple[str, str]],
|
|
|
|
| 13 |
max_tokens,
|
| 14 |
temperature,
|
| 15 |
top_p,
|
| 16 |
):
|
| 17 |
+
# Fixed system message
|
| 18 |
+
system_message = "You are a coding assistant developed by the ACC(Algorithmic Computer-generated Consciousness)."
|
| 19 |
+
|
| 20 |
messages = [{"role": "system", "content": system_message}]
|
| 21 |
|
| 22 |
for val in history:
|
|
|
|
| 45 |
"""
|
| 46 |
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
| 47 |
"""
|
| 48 |
+
theme = gr.themes.Monochrome()
|
| 49 |
+
|
| 50 |
demo = gr.ChatInterface(
|
| 51 |
respond,
|
| 52 |
additional_inputs=[
|
|
|
|
| 53 |
gr.Slider(minimum=1, maximum=2048, value=2048, step=1, label="Max new tokens"),
|
| 54 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
| 55 |
gr.Slider(
|