Chris4K commited on
Commit
83c4a82
1 Parent(s): 9c4e039

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -323,7 +323,7 @@ def phonetic_match(text, query, method='levenshtein_distance', apply_phonetic=Fa
323
 
324
  from typing import List, Union
325
  import torch
326
- from transformers import AutoTokenizer, AutoModelForSeq2Gen
327
  import numpy as np
328
  from nltk.tokenize import word_tokenize
329
  from nltk.corpus import wordnet
@@ -375,7 +375,7 @@ def optimize_query(
375
  model_max_length=128, # Limit maximum sequence length
376
  cache_dir="./model_cache" # Cache models locally
377
  )
378
- model = AutoModelForSeq2Gen.from_pretrained(
379
  model_name,
380
  low_cpu_mem_usage=True, # Enable low memory usage
381
  device_map="cpu" # Explicitly set to CPU
 
323
 
324
  from typing import List, Union
325
  import torch
326
+ from transformers import AutoTokenizer
327
  import numpy as np
328
  from nltk.tokenize import word_tokenize
329
  from nltk.corpus import wordnet
 
375
  model_max_length=128, # Limit maximum sequence length
376
  cache_dir="./model_cache" # Cache models locally
377
  )
378
+ model = AutoModel.from_pretrained(
379
  model_name,
380
  low_cpu_mem_usage=True, # Enable low memory usage
381
  device_map="cpu" # Explicitly set to CPU