Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
0686401
1
Parent(s):
eb893c3
Playing with different models.
Browse files
app.py
CHANGED
@@ -10,11 +10,12 @@ 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 |
-
|
|
|
14 |
|
15 |
gradio_interface = gradio.Interface(
|
16 |
fn = zero_shot_classification,
|
17 |
inputs = gradio.Textbox(label="JSON Input"),
|
18 |
-
outputs = gradio.
|
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 |
+
response_string = json.dumps(results)
|
14 |
+
return response_string
|
15 |
|
16 |
gradio_interface = gradio.Interface(
|
17 |
fn = zero_shot_classification,
|
18 |
inputs = gradio.Textbox(label="JSON Input"),
|
19 |
+
outputs = gradio.Textbox()
|
20 |
)
|
21 |
gradio_interface.launch()
|