Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
6c660fd
1
Parent(s):
7f9bb78
Playing with different models.
Browse files
app.py
CHANGED
@@ -10,11 +10,11 @@ def zero_shot_classification(data_string):
|
|
10 |
data = json.loads(data_string)
|
11 |
print(data)
|
12 |
results = classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|
13 |
-
return results
|
14 |
|
15 |
gradio_interface = gradio.Interface(
|
16 |
fn = zero_shot_classification,
|
17 |
inputs = gradio.Textbox(label="JSON Input"),
|
18 |
-
outputs = "
|
19 |
)
|
20 |
gradio_interface.launch()
|
|
|
10 |
data = json.loads(data_string)
|
11 |
print(data)
|
12 |
results = classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|
13 |
+
return json.dumps(results)
|
14 |
|
15 |
gradio_interface = gradio.Interface(
|
16 |
fn = zero_shot_classification,
|
17 |
inputs = gradio.Textbox(label="JSON Input"),
|
18 |
+
outputs = "json"
|
19 |
)
|
20 |
gradio_interface.launch()
|