Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
de9282c
1
Parent(s):
e0addea
Messing with configuration.
Browse files
app.py
CHANGED
@@ -54,7 +54,6 @@ print(f"pipeline")
|
|
54 |
classifier = pipeline(task="zero-shot-classification", model=model_name, tokenizer=tokenizer_name, device="cuda:0")
|
55 |
|
56 |
print(f"Testing 1")
|
57 |
-
@spaces.GPU
|
58 |
def classify(data_string, request: gradio.Request):
|
59 |
if request:
|
60 |
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win", "https://crunchatize-2-2b4f5b1479a6.c5v4v4jx6pq5.win", "https://tamabotchi-2dba63df3bf1.c5v4v4jx6pq5.win", "https://ravenok-statosphere-backend.hf.space", "https://lord-raven.github.io"]:
|
@@ -66,6 +65,7 @@ def classify(data_string, request: gradio.Request):
|
|
66 |
return zero_shot_classification(data)
|
67 |
|
68 |
print(f"Testing 2")
|
|
|
69 |
def zero_shot_classification(data):
|
70 |
results = classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|
71 |
response_string = json.dumps(results)
|
|
|
54 |
classifier = pipeline(task="zero-shot-classification", model=model_name, tokenizer=tokenizer_name, device="cuda:0")
|
55 |
|
56 |
print(f"Testing 1")
|
|
|
57 |
def classify(data_string, request: gradio.Request):
|
58 |
if request:
|
59 |
if request.headers["origin"] not in ["https://statosphere-3704059fdd7e.c5v4v4jx6pq5.win", "https://crunchatize-77a78ffcc6a6.c5v4v4jx6pq5.win", "https://crunchatize-2-2b4f5b1479a6.c5v4v4jx6pq5.win", "https://tamabotchi-2dba63df3bf1.c5v4v4jx6pq5.win", "https://ravenok-statosphere-backend.hf.space", "https://lord-raven.github.io"]:
|
|
|
65 |
return zero_shot_classification(data)
|
66 |
|
67 |
print(f"Testing 2")
|
68 |
+
@spaces.GPU
|
69 |
def zero_shot_classification(data):
|
70 |
results = classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|
71 |
response_string = json.dumps(results)
|