ragerri commited on
Commit
fbef86d
·
verified ·
1 Parent(s): 9ada002

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -21,7 +21,20 @@ import gradio as gr
21
  import os
22
  access_token = os.environ['HF_TOKEN']
23
 
 
24
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  client = InferenceClient("mistralai/Mistral-7B-v0.1",access_token)
26
 
27
  def format_prompt(message, history):
@@ -105,4 +118,5 @@ gr.ChatInterface(
105
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
106
  additional_inputs=additional_inputs,
107
  title="""Mistral 7B fine-tuned on MedExpQA with max RAG 32"""
108
- ).launch(show_api=False)
 
 
21
  import os
22
  access_token = os.environ['HF_TOKEN']
23
 
24
+ import requests
25
 
26
+ API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-v0.1"
27
+ headers = {"Authorization": "Bearer "+access_token}
28
+
29
+ def query(payload):
30
+ response = requests.post(API_URL, headers=headers, json=payload)
31
+ return response.json()
32
+
33
+ output = query({
34
+ "inputs": "Can you please let us know more details about your ",
35
+ })
36
+
37
+ """
38
  client = InferenceClient("mistralai/Mistral-7B-v0.1",access_token)
39
 
40
  def format_prompt(message, history):
 
118
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
119
  additional_inputs=additional_inputs,
120
  title="""Mistral 7B fine-tuned on MedExpQA with max RAG 32"""
121
+ ).launch(show_api=False)
122
+ """