Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,9 @@ API_URL = "https://api-inference.huggingface.co/models/project-baize/baize-v2-7b
|
|
5 |
headers = {"Authorization": "Bearer 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"}
|
6 |
|
7 |
def query(txt):
|
|
|
8 |
payload = {'inputs' : txt}
|
9 |
-
|
10 |
-
|
11 |
|
12 |
gr.Interface(fn=query, inputs='text', outputs = 'text').launch()
|
|
|
5 |
headers = {"Authorization": "Bearer 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"}
|
6 |
|
7 |
def query(txt):
|
8 |
+
|
9 |
payload = {'inputs' : txt}
|
10 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
11 |
+
return response.json()
|
12 |
|
13 |
gr.Interface(fn=query, inputs='text', outputs = 'text').launch()
|