Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from mistralai.models.chat_completion import ChatMessage
|
|
7 |
client = MistralClient(api_key= os.getenv('mistral_api_key'))
|
8 |
|
9 |
# Function to get chat response
|
10 |
-
def get_mistral_response(user_input, history: list[tuple[str, str]], context):
|
11 |
messages = [ChatMessage(role='user', content='you are helpful assistant answering question based on given context. provide a highly consie and precise answer, along with a citation from original context in the format of JSON.'),
|
12 |
ChatMessage(role='assistant', content='I understand.')] # system prompt has been baked into fine-tuned model.
|
13 |
|
@@ -29,7 +29,7 @@ def get_mistral_response(user_input, history: list[tuple[str, str]], context):
|
|
29 |
demo = gr.ChatInterface(
|
30 |
get_mistral_response,
|
31 |
title='no-nonsense QA bot',
|
32 |
-
description="After fine-tuning, the bot answers your question with grounded citation.
|
33 |
additional_inputs=[
|
34 |
gr.Textbox(value="", label="Answer will be based on the context input here", lines=10),
|
35 |
],
|
|
|
7 |
client = MistralClient(api_key= os.getenv('mistral_api_key'))
|
8 |
|
9 |
# Function to get chat response
|
10 |
+
def get_mistral_response(user_input: str, history: list[tuple[str, str]], context: str):
|
11 |
messages = [ChatMessage(role='user', content='you are helpful assistant answering question based on given context. provide a highly consie and precise answer, along with a citation from original context in the format of JSON.'),
|
12 |
ChatMessage(role='assistant', content='I understand.')] # system prompt has been baked into fine-tuned model.
|
13 |
|
|
|
29 |
demo = gr.ChatInterface(
|
30 |
get_mistral_response,
|
31 |
title='no-nonsense QA bot',
|
32 |
+
description="After fine-tuning, the bot answers your question with a grounded citation. Paste your contextual information in the box below.",
|
33 |
additional_inputs=[
|
34 |
gr.Textbox(value="", label="Answer will be based on the context input here", lines=10),
|
35 |
],
|