Spaces:
Sleeping
Sleeping
Commit
·
410fa27
1
Parent(s):
e3e97c6
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,7 +47,6 @@ def run(message, chat_history, system_prompt, max_new_tokens=1024, temperature=0
|
|
| 47 |
yield output
|
| 48 |
return output
|
| 49 |
|
| 50 |
-
|
| 51 |
DEFAULT_SYSTEM_PROMPT = """
|
| 52 |
You are Mistral. You are an AI assistant, you are moderately-polite and give only true information.
|
| 53 |
You carefully provide accurate, factual, thoughtful, nuanced answers, and are brilliant at reasoning.
|
|
@@ -55,7 +54,6 @@ DEFAULT_SYSTEM_PROMPT = """
|
|
| 55 |
each token you produce is another opportunity to use computation, therefore you always spend a few sentences explaining background context,
|
| 56 |
assumptions, and step-by-step thinking BEFORE you try to answer a question.
|
| 57 |
"""
|
| 58 |
-
|
| 59 |
MAX_MAX_NEW_TOKENS = 4096
|
| 60 |
DEFAULT_MAX_NEW_TOKENS = 256
|
| 61 |
MAX_INPUT_TOKEN_LENGTH = 4000
|
|
@@ -63,7 +61,7 @@ MAX_INPUT_TOKEN_LENGTH = 4000
|
|
| 63 |
DESCRIPTION = "# [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1)"
|
| 64 |
|
| 65 |
def clear_and_save_textbox(message): return '', message
|
| 66 |
-
|
| 67 |
def display_input(message, history=[]):
|
| 68 |
history.append((message, ''))
|
| 69 |
return history
|
|
@@ -104,7 +102,7 @@ with gr.Blocks(theme='Taithrah/Minimal') as demo:
|
|
| 104 |
gr.Markdown(DESCRIPTION)
|
| 105 |
|
| 106 |
with gr.Group():
|
| 107 |
-
chatbot = gr.Chatbot(label='
|
| 108 |
with gr.Row():
|
| 109 |
textbox = gr.Textbox(
|
| 110 |
container=False,
|
|
|
|
| 47 |
yield output
|
| 48 |
return output
|
| 49 |
|
|
|
|
| 50 |
DEFAULT_SYSTEM_PROMPT = """
|
| 51 |
You are Mistral. You are an AI assistant, you are moderately-polite and give only true information.
|
| 52 |
You carefully provide accurate, factual, thoughtful, nuanced answers, and are brilliant at reasoning.
|
|
|
|
| 54 |
each token you produce is another opportunity to use computation, therefore you always spend a few sentences explaining background context,
|
| 55 |
assumptions, and step-by-step thinking BEFORE you try to answer a question.
|
| 56 |
"""
|
|
|
|
| 57 |
MAX_MAX_NEW_TOKENS = 4096
|
| 58 |
DEFAULT_MAX_NEW_TOKENS = 256
|
| 59 |
MAX_INPUT_TOKEN_LENGTH = 4000
|
|
|
|
| 61 |
DESCRIPTION = "# [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1)"
|
| 62 |
|
| 63 |
def clear_and_save_textbox(message): return '', message
|
| 64 |
+
|
| 65 |
def display_input(message, history=[]):
|
| 66 |
history.append((message, ''))
|
| 67 |
return history
|
|
|
|
| 102 |
gr.Markdown(DESCRIPTION)
|
| 103 |
|
| 104 |
with gr.Group():
|
| 105 |
+
chatbot = gr.Chatbot(label='Mistral-7B-Instruct-v0.1')
|
| 106 |
with gr.Row():
|
| 107 |
textbox = gr.Textbox(
|
| 108 |
container=False,
|