Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
d65667c
1
Parent(s):
e355e92
Messing with configuration.
Browse files
app.py
CHANGED
@@ -47,7 +47,7 @@ print(f"CUDA device: {torch.cuda.get_device_name(torch.cuda.current_device())}")
|
|
47 |
# classifier = pipeline(task="zero-shot-classification", model=model, tokenizer=tokenizer, device="cuda:0")
|
48 |
|
49 |
print(f"Testing 1")
|
50 |
-
|
51 |
def classify(data_string, request: gradio.Request):
|
52 |
if request:
|
53 |
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"]:
|
@@ -59,7 +59,6 @@ def classify(data_string, request: gradio.Request):
|
|
59 |
return zero_shot_classification(data)
|
60 |
|
61 |
print(f"Testing 2")
|
62 |
-
# @spaces.GPU()
|
63 |
def zero_shot_classification(data):
|
64 |
results = []
|
65 |
# classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|
|
|
47 |
# classifier = pipeline(task="zero-shot-classification", model=model, tokenizer=tokenizer, device="cuda:0")
|
48 |
|
49 |
print(f"Testing 1")
|
50 |
+
@spaces.GPU()
|
51 |
def classify(data_string, request: gradio.Request):
|
52 |
if request:
|
53 |
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"]:
|
|
|
59 |
return zero_shot_classification(data)
|
60 |
|
61 |
print(f"Testing 2")
|
|
|
62 |
def zero_shot_classification(data):
|
63 |
results = []
|
64 |
# classifier(data['sequence'], candidate_labels=data['candidate_labels'], hypothesis_template=data['hypothesis_template'], multi_label=data['multi_label'])
|