ds-EkaCare commited on
Commit
3d8ce85
Β·
verified Β·
1 Parent(s): 0adf63d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -12,7 +12,7 @@ from pinecone import Pinecone
12
  # Retriever Class
13
  # =========================
14
  class ParrotletRetriever:
15
- def __init__(self, model_name: str, pinecone_api_key: str, index_name: str):
16
  """Initialize model and Pinecone client."""
17
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
18
  print(f"πŸš€ Loading model on {self.device}...")
@@ -50,7 +50,7 @@ class ParrotletRetriever:
50
  """Encode text into normalized embeddings."""
51
  with torch.no_grad():
52
  encoded_input = self.tokenizer(
53
- texts, padding=True, truncation=True, max_length=512, return_tensors="pt"
54
  ).to(self.device)
55
 
56
  model_output = self.model(**encoded_input)
 
12
  # Retriever Class
13
  # =========================
14
  class ParrotletRetriever:
15
+ def __init__(self, model_name: str):
16
  """Initialize model and Pinecone client."""
17
  self.device = "cuda" if torch.cuda.is_available() else "cpu"
18
  print(f"πŸš€ Loading model on {self.device}...")
 
50
  """Encode text into normalized embeddings."""
51
  with torch.no_grad():
52
  encoded_input = self.tokenizer(
53
+ texts, padding=True, truncation=True, max_length=60, return_tensors="pt"
54
  ).to(self.device)
55
 
56
  model_output = self.model(**encoded_input)