Kaushik Bar
commited on
Commit
•
c09ae13
1
Parent(s):
ab91900
first commit
Browse files
app.py
CHANGED
@@ -3,8 +3,8 @@ import gradio as gr
|
|
3 |
import fasttext, torch, clip
|
4 |
from sentence_transformers import SentenceTransformer, util
|
5 |
|
6 |
-
model_en,
|
7 |
-
model_multi = SentenceTransformer(
|
8 |
|
9 |
def prep_examples():
|
10 |
example_text1 = "Coronavirus disease (COVID-19) is an infectious disease caused by the SARS-CoV-2 virus. Most \
|
@@ -85,7 +85,6 @@ def sequence_to_classify(text, labels):
|
|
85 |
lang = detect_lang(text)
|
86 |
if lang == 'en':
|
87 |
model = model_en
|
88 |
-
preprocess = preprocess_en
|
89 |
hypothesis_template = "This example is {}."
|
90 |
else:
|
91 |
model = model_multi
|
|
|
3 |
import fasttext, torch, clip
|
4 |
from sentence_transformers import SentenceTransformer, util
|
5 |
|
6 |
+
model_en, _ = clip.load("ViT-B/32")
|
7 |
+
model_multi = SentenceTransformer("sentence-transformers/clip-ViT-B-32-multilingual-v1")
|
8 |
|
9 |
def prep_examples():
|
10 |
example_text1 = "Coronavirus disease (COVID-19) is an infectious disease caused by the SARS-CoV-2 virus. Most \
|
|
|
85 |
lang = detect_lang(text)
|
86 |
if lang == 'en':
|
87 |
model = model_en
|
|
|
88 |
hypothesis_template = "This example is {}."
|
89 |
else:
|
90 |
model = model_multi
|