wop commited on
Commit
69e6331
1 Parent(s): 1939e34

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -8,7 +8,8 @@ API_URL2 = "https://api-inference.huggingface.co/models/valhalla/longformer-base
8
  headers2 = {"Authorization": "Bearer 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"}
9
 
10
  def query(payload):
11
- response = requests.post(API_URL, headers=headers, json=payload)
 
12
  return response.json()["answer"]
13
 
14
  def query2(question, context): # Accept two arguments
@@ -23,6 +24,13 @@ iface = gr.Interface(
23
  title="AI Interface",
24
  description="Ask the AI model anything!",
25
  )
 
 
 
 
 
 
 
26
 
27
  iface.launch()
28
 
 
8
  headers2 = {"Authorization": "Bearer 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"}
9
 
10
  def query(payload):
11
+ payload2 = "whats the context of teh question " + paylaod + " :"
12
+ response = requests.post(API_URL, headers=headers, json=payload2)
13
  return response.json()["answer"]
14
 
15
  def query2(question, context): # Accept two arguments
 
24
  title="AI Interface",
25
  description="Ask the AI model anything!",
26
  )
27
+ iface2 = gr.Interface(
28
+ fn=query,
29
+ inputs=[gr.Textbox("question")],
30
+ outputs=gr.Textbox("answer"),
31
+ title="AI Interface",
32
+ description="Ask the AI model anything!",
33
+ )
34
 
35
  iface.launch()
36