ameyjoshi8198 commited on
Commit
1c6076d
·
verified ·
1 Parent(s): 46336b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -28,13 +28,13 @@ Here is the relevant evidence from the database:
28
 
29
  Answer this question based only on the evidence above:
30
  {question}"""
31
-
32
- response = client.text_generation(
33
- prompt,
34
  model="mistralai/Mistral-7B-Instruct-v0.3",
35
- max_new_tokens=512
36
  )
37
- return response
38
 
39
  demo = gr.Interface(
40
  fn=answer_question,
 
28
 
29
  Answer this question based only on the evidence above:
30
  {question}"""
31
+
32
+ response = client.chat_completion(
33
+ messages=[{"role": "user", "content": prompt}],
34
  model="mistralai/Mistral-7B-Instruct-v0.3",
35
+ max_tokens=512
36
  )
37
+ return response.choices[0].message.content
38
 
39
  demo = gr.Interface(
40
  fn=answer_question,