Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
| 3 |
import requests
|
|
|
|
| 4 |
headers = {"Authorization": f"Bearer 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"}
|
| 5 |
API_URL = "https://api-inference.huggingface.co/models/facebook/bart-large-mnli"
|
| 6 |
#API_URL = "https://api-inference.huggingface.co/models/microsoft/DialoGPT-large"
|
|
@@ -19,6 +20,10 @@ def query(payload):
|
|
| 19 |
},
|
| 20 |
}
|
| 21 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
data = {
|
| 23 |
"inputs": {
|
| 24 |
"question": payload,
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import json
|
| 3 |
import requests
|
| 4 |
+
from transformers import pipeline
|
| 5 |
headers = {"Authorization": f"Bearer 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"}
|
| 6 |
API_URL = "https://api-inference.huggingface.co/models/facebook/bart-large-mnli"
|
| 7 |
#API_URL = "https://api-inference.huggingface.co/models/microsoft/DialoGPT-large"
|
|
|
|
| 20 |
},
|
| 21 |
}
|
| 22 |
"""
|
| 23 |
+
|
| 24 |
+
classifier = pipeline("zero-shot-classification", model="facebook/bart-large-mnli")
|
| 25 |
+
|
| 26 |
+
|
| 27 |
data = {
|
| 28 |
"inputs": {
|
| 29 |
"question": payload,
|