jingwang commited on
Commit
94300cf
·
verified ·
1 Parent(s): e3b955d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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. Copy 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
  ],
 
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
  ],