Skip to content

Commit

Permalink
set TOKENIZERS_PARALLELISM if not
Browse files Browse the repository at this point in the history
  • Loading branch information
wongjingping committed Aug 19, 2023
1 parent 3259525 commit d2e779f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/pruning.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import os
from typing import Dict, List, Tuple
from sentence_transformers import SentenceTransformer
import spacy
import pickle
import torch
import torch.nn.functional as F

if os.getenv("TOKENIZERS_PARALLELISM") is None:
os.environ["TOKENIZERS_PARALLELISM"] = "false"
encoder = SentenceTransformer("sentence-transformers/all-MiniLM-L6-v2")
nlp = spacy.load("en_core_web_sm")

Expand Down

0 comments on commit d2e779f

Please sign in to comment.